Check out several branches at once with git worktree

Also on X

git worktree checks out another branch into a separate folder, backed by the same repository. No more stashing half-done work just to review a PR or fix something on main.

git worktree add ../hotfix main
cd ../hotfix
# fix, commit, push
git worktree remove ../hotfix

I’m in good company: even Guido van Rossum asked why he hadn’t known about it sooner. Docs · Video

← All TILs