Skip to content

Instantly share code, notes, and snippets.

@Crydust
Created April 29, 2023 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Crydust/0fe044bff3bc2d74080dcbc9db7d3d17 to your computer and use it in GitHub Desktop.
Save Crydust/0fe044bff3bc2d74080dcbc9db7d3d17 to your computer and use it in GitHub Desktop.

Git worktree

# clone the repo, but switch it to a dummybranch so other worktrees can checkout the main branch
git clone --no-checkout URL_HERE repo.git
cd repo.git
git switch -c dummy

# add a worktree
git worktree add ../repo_main main
cd ../repo_main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment