One of the most important features of git in terms of AI is git worktree. It allows you to checkout different branches at the same time in different folders like so:
git worktree add <branch> path
And all worktrees share the common stash list between them. This is crucial for AI use in projects where you might be running a long training job in one worktree, while simultaneously preprocessing data in another, and fixing a bug in code in a third—all without conflicts or context switching.
One of the big drawbacks of git worktree in my opinion was always unintuitive syntax, where I always would have to look up how to do a specific thing.
My solution: gwt
To fix this, I created gwt, a simple helper that makes git worktree intuitive.
Onc…
One of the most important features of git in terms of AI is git worktree. It allows you to checkout different branches at the same time in different folders like so:
git worktree add <branch> path
And all worktrees share the common stash list between them. This is crucial for AI use in projects where you might be running a long training job in one worktree, while simultaneously preprocessing data in another, and fixing a bug in code in a third—all without conflicts or context switching.
One of the big drawbacks of git worktree in my opinion was always unintuitive syntax, where I always would have to look up how to do a specific thing.
My solution: gwt
To fix this, I created gwt, a simple helper that makes git worktree intuitive.
Once installed you can simply type:
gwt
To list all available worktrees.
Before gwt
You would have to git worktree list → copy the path → cd ../../path/to/the-other-feature.
With gwt
Just run gwt and choose the branch and you’re there.
gwt add <branch> would automatically create a new worktree with checked out branch.
If you already know the branch’s worktree you want to jump into you can simply type gwt <branch>. Gwt supports autocomplete for branch names.
And finally gwt remove interactively prompts you to choose which worktree to delete.