GIT-WORKTREE(1) Git Manual GIT-WORKTREE(1) (NAME) git-worktree - (SYNOPSIS) git worktree add [-f] [--detach] [--checkout] [--lock [--reason ]] [--orphan] [(-b | -B) ] [] git worktree list [-v | --porcelain [-z]] git worktree lock [--reason ] git worktree move git worktree prune [-n] [-v] [--expire ] git worktree remove [-f] git worktree repair [...] git worktree unlock (DESCRIPTION) . (checkout) . git worktree add . <> . << >> (main worktree) git-init(1) git-clone(1) << >> (linked worktree) . ( bare ) . git worktree remove . git worktree add . git worktree add ../hotfix hotfix ../hotfix . git worktree add . (throwaway) . git worktree add -d HEAD (detached) . git worktree remove ( << (DETAILS)>> ) ( gc.worktreePruneExpire git-config(1) ) git worktree prune . (mount) git worktree lock --reason . (COMMANDS) add [] . HEAD index . <<->> @{-1} . ( ) -b -B --detach ( ) : $ git worktree add --track -b / checkout.defaultRemote . checkout.defaultRemote=origin origin . checkout.defaultRemote git-config(1) . -b -B --detach ( ) $(basename ) . HEAD -b . ( --force ). --detach --orphan ( --guess-remote ) ( $(basename ) -b -B ) --orphan . --guess-remote (fetch) ( -f/--force ). list . . bare (revision) ( <> ) <> <> prune . lock . . --reason . move . . ( git worktree repair .) prune $GIT_DIR/worktrees . ( <> ). <> . remove . ( ) . --force . . repair [...] . ( bare) . repair . git worktree move ( bare) . repair . repair . repair . unlock . (OPTIONS) -f, --force add ( ). . --force . move --force . ( ) --force --force . remove --force . --force . -b , -B add . HEAD . -b . -B . -d, --detach add HEAD . <> git- checkout(1) . --checkout, --no-checkout add --no-checkout ( sparse-checkout) . <> git-read- tree(1) . --guess-remote, --no-guess-remote worktree add HEAD (<>) . worktree.guessRemote . --relative-paths, --no-relative-paths () . worktree.useRelativePaths git-config(1) . repair / . --track, --no-track . . --track git-branch(1) . --lock . git worktree lock git worktree add (race condition). -n, --dry-run prune . --orphan add . --porcelain list . . -z . . -z --porcelain list NUL . . -q, --quiet add . -v, --verbose prune . list ( ). --expire