How to Work on Multiple Branches Simultaneously with Git Worktree
In a hurry? Watch our brief 1-minute vertical video that summarizes the info below.
Have you ever been in the middle of a feature and needed to quickly switch to another branch to fix a bug? The usual workflow involves stashing your changes or creating a temporary commit.
However, Git offers a more powerful solution: Worktrees.
A Git worktree is a linked working directory that allows you to have multiple branches checked out at the same time. This is perfect for situations like hotfixes, where you can work on the fix in a separate, clean directory without disrupting your main line of work.
Creating a Worktree
To create a new worktree, you can use the git worktree add command. It takes two main arguments: the path for the new working directory and the branch you want to check out.
Let's say you want to create a hotfix. First, you might create a new branch:
$ git checkout -b hotfix
Now, you can create a new worktree for this branch. It's a good practice to create the worktree directory outside of your main project folder to avoid confusion.
$ git worktree add ../hotfix-worktree hotfix
This command creates a new directory named hotfix-worktree one level up from your current project. Inside this directory, you'll find your project files with the hotfix branch checked out, ready for you to work on.
The Git Cheat Sheet
No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!
Managing Your Worktrees
You can see a list of all your worktrees at any time with the git worktree list command. This will show you the path to each worktree and the branch that is checked out.
$ git worktree list
Once you are done with your work in the worktree (e.g., you've committed your hotfix), you can remove it. You don't delete the directory yourself; instead, you use the git worktree remove command:
$ git worktree remove ../hotfix-worktree
Tip
Worktrees in Tower
The Tower Git client makes using worktrees incredibly simple. You can right-click any branch in the sidebar and select "Create Worktree". Active worktrees are clearly marked with a special icon, making it easy to see which branches are checked out in a separate working directory.

Learn More
- The official Git documentation for
git-worktreeprovides a comprehensive overview of all its capabilities.
Get our popular Git Cheat Sheet for free!
You'll find the most important commands on the front and helpful best practice tips on the back. Over 100,000 developers have downloaded it to make Git a little bit easier.
About Us
As the makers of Tower, the best Git client for Mac and Windows, we help over 100,000 users in companies like Apple, Google, Amazon, Twitter, and Ebay get the most out of Git.
Just like with Tower, our mission with this platform is to help people become better professionals.
That's why we provide our guides, videos, and cheat sheets (about version control with Git and lots of other topics) for free.