git worktree
Table of Contents
git worktree
reference
# Basics
$ git fetch
$ git worktree add -b bugfix-1234 ../bugfix origin/master
# Temporary
$ git worktree add --detach ../project-build HEAD
# Cleanup
$ rm -rf ../bugfix && git worktree prune
-b bugfix-1234
option creates a new branch namedbugfix-1234
../bugfix
is the new local copy- Based on
origin/master
--detach
makes the working copy detached. (Just commmit, not the branch)