Loading...
Loading...
Use when needing multiple checked-out branches simultaneously without re-cloning — review a PR while keeping WIP, per-branch build caches, or hotfix alongside feature work
npx skill4agent add narenaryan/agent-skills git-worktrees.gitgit worktree add ../hotfix hotfix-branch # existing branch
git worktree add -b new-branch ../new main # create from main
git worktree add --detach ../inspect <sha> # for read-only review
git worktree list [--porcelain]
git worktree lock ../critical # prevent prune
git worktree move ../old ../new
git worktree remove ../hotfix # after cd out
git worktree prune # clean stale metadata
git worktree repair # fix links after moves--detach--forceremove.gitrm -rf.git/worktrees/<name>/prunegit worktree add ../review-1234 --detach origin/pr/1234git worktree add -b hotfix/urgent ../hotfix origin/mainnode_modulestarget/git bisect rungit config extensions.worktreeConfig true
git config --worktree user.email alt@example.comcore.barecore.worktreepost-checkoutyarn installrefs/stash.gitgit worktree prune