Skip to content

Instantly share code, notes, and snippets.

@ludwigdn
Last active September 4, 2025 12:47
Show Gist options
  • 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