TIL

git worktree for a hotfix without stashing

git worktree add checks out a second branch in its own folder. The half-done work stays where it is.

$ git worktree add ../stummel-hotfix main
$ cd ../stummel-hotfix
$ git switch -c fix/query-string

git worktree remove ../stummel-hotfix cleans up once it is merged.

Comments

Buy Logbuch