That was also my case a couple of years ago, when I learned about git worktress completely by accident. But since then, they have become the base of m

Worktrees: Git's best kept secret (and why you should use them)

submited by
Style Pass
2025-08-07 21:30:06

That was also my case a couple of years ago, when I learned about git worktress completely by accident. But since then, they have become the base of my development workflow.

The fact that worktrees have been part of Git since 2015 makes it even more surprising that they remain so rarely known. But what if I told you…

In fact it’s very simple: a working tree is the same as a working directory, this is, the directory with the files that you are working on.

You are working on that cool new feature, when suddenly the alarms go blaring 🚨. Production is down! You have to deploy a hotfix, and you have to do it fast!

With worktrees, you can instead switch between branches just by changing directories, without losing any of your work in the process, even if it’s not committed.

git worktree remove [path] deletes a worktree. Keep in mind that this will delete the local folder, but the branch will still exist.

Leave a Comment
Related Posts