Skip to content

Instantly share code, notes, and snippets.

@ludwigdn
Last active September 15, 2021 10:37
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 ludwigdn/46265813924500b0bc3e95dad6eb7cf8 to your computer and use it in GitHub Desktop.
Save ludwigdn/46265813924500b0bc3e95dad6eb7cf8 to your computer and use it in GitHub Desktop.
Git worktrees cheatsheet

Git worktrees cheatsheet

Create new worktree from existing branch

git worktree add <WORKTREE-PATH> <BRANCH>

Create new branch and its worktree

git worktree add -b <BRANCH> <WORKTREE-PATH>

List current worktrees

git worktree list

Delete a worktree

git worktree remove <WORKTREE-PATH>

Clean up worktrees metadatas

git worktree prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment