Worktree
git worktree
git worktree add master
- Create a bare repo and start making new worktrees import.git (Private)
- This means that a copy of the repo files is made for each worktree at the source commit that the bare repo was made from
- Worktrees make it easier to open multiple repo branches at once under a unified workspace for easy switching of work between multiple features
- Doesn't lend itself to easy updating.
- The bare repo doesn't
git pull
itself but the worktrees after creation can use git pull
but this is not ideal. The bare repo is basically frozen at a single commit for all new worktrees made.
Making work-trees
git clone --bare <repo url.git> <name of the folder to create>
git clone --bare git@github.com:tallguyjenks/CV.git CV
git worktree add master
git worktree add test
git worktree add feature