Skip to main content

8.5 Worktree

Also see the git-worktree(1) manpage.

Z     (magit-worktree)

This transient prefix command binds the following suffix commands and displays them in a temporary buffer until a suffix is invoked.

Z b     (magit-worktree-checkout)

Checkout BRANCH in a new worktree at PATH.

Z c     (magit-worktree-branch)

Create a new BRANCH and check it out in a new worktree at PATH.

Z m     (magit-worktree-move)

Move an existing worktree to a new PATH.

Z k     (magit-worktree-delete)

Delete a worktree, defaulting to the worktree at point. The primary worktree cannot be deleted.

Z g     (magit-worktree-status)

Show the status for the worktree at point.

If there is no worktree at point, then read one in the minibuffer. If the worktree at point is the one whose status is already being displayed in the current buffer, then show it in Dired instead.