Skip to content

Repository files navigation

gji — Switch Git contexts without stashing

Start, review, and switch between Git tasks without disturbing the work already open.

gji makes Git worktrees feel like normal shell navigation. Each task gets its own directory, dependencies, editor context, and terminal — so moving to a pull request or experiment does not require stashing, checking out, or reinstalling.

Start your next task

Run gji new and let the interactive flow guide you into a fresh worktree:

gji new

Choose a task name and setup options, then continue working in the new directory. For repeatable workflows, you can still provide a branch directly:

gji new feature/payment-refactor

The problem

You are halfway through a feature when someone asks you to review a pull request. Without worktrees, a quick review often becomes:

stash → checkout → reinstall → review → checkout back → stash pop

With gji, the review gets its own workspace and your current task stays untouched:

gji pr 1234
Before
Traditional branch switching with stash and reinstall steps
After
Creating an isolated pull request worktree with gji

Remember four commands

gji new                            # interactively start a task
gji pr 1234                        # open a pull request in isolation
gji go main                        # jump to another worktree
gji done feature/payment-refactor  # finish and clean up a task

With shell integration enabled, each command moves your shell into the selected worktree automatically.

Install

npm install -g @solaqua/gji
gji init

gji init interactively installs shell integration, completions, and an available editor. Restart your shell, or source the rc file shown by the wizard, then run:

gji doctor

Without shell integration, commands still print paths for scripts and other non-interactive use. See the installation guide for explicit shell setup.

A typical day

# Start feature work
gji new

# Check what is active
gji

# Review a PR without changing the current task
gji pr 1234

# Move between tasks
gji go feature/payment-refactor
gji back

# Keep worktrees current and remove finished work
gji sync
gji done feature/payment-refactor

Worktrees use a predictable location by default:

../worktrees/<repo>/<branch>

That keeps editor bookmarks, scripts, and terminal navigation stable.

More capabilities

Use the documentation when you need to go beyond the core workflow:

gji also supports JSON output for scripts and AI-assisted workflows:

gji --json
gji new --json feature/dark-mode
gji go --json feature/dark-mode

Read the full documentation for configuration, dependency bootstrap, hooks, automation, and the complete CLI reference.


If gji has saved you from a git stash spiral, a ⭐ on GitHub helps other developers find it.

License

MIT

About

Context switching without the mess. The ultimate Git Worktree workflow for power users.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages