git worktree

Over the past couple of months I've had to work on a number of projects at the same time for a couple of clients. Git worktree, which was introduced in Git 2.5 has been a lifesaver for me.

I often have a development branch that I'm working on and often have a server running on that branch as well so my client can see the work. At the same time, I'll be working on another feature while they are reviewing the work that I've been doing. Before, that would require me to check out the other branch in another directory and while that would work, getting the work between the two branches was often difficult.

The nice thing with git-worktree is that all of the separate branches (and folders) share the same base repository, so all changes in one repo are reflected in all worktrees.

Give it a try. I think that you'll find that it helps out tremendously.

Share this post