Previous: , Up: Manipulating   [Contents][Index]


6.11 Stashing

Also see the git-stash(1) manpage.

z     (magit-stash)

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

z z     (magit-stash-both)

Create a stash of the index and working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to --include-untracked while two prefix arguments are equivalent to --all.

z i     (magit-stash-index)

Create a stash of the index only. Unstaged and untracked changes are not stashed.

z w     (magit-stash-worktree)

Create a stash of unstaged changes in the working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to --include-untracked while two prefix arguments are equivalent to --all.

z x     (magit-stash-keep-index)

Create a stash of the index and working tree, keeping index intact. Untracked files are included according to infix arguments. One prefix argument is equivalent to --include-untracked while two prefix arguments are equivalent to --all.

z Z     (magit-snapshot-both)

Create a snapshot of the index and working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to --include-untracked while two prefix arguments are equivalent to --all.

z I     (magit-snapshot-index)

Create a snapshot of the index only. Unstaged and untracked changes are not stashed.

z W     (magit-snapshot-worktree)

Create a snapshot of unstaged changes in the working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to --include-untracked while two prefix arguments are equivalent to --all-.

z a     (magit-stash-apply)

Apply a stash to the working tree. Try to preserve the stash index. If that fails because there are staged changes, apply without preserving the stash index.

z p     (magit-stash-pop)

Apply a stash to the working tree and remove it from stash list. Try to preserve the stash index. If that fails because there are staged changes, apply without preserving the stash index and forgo removing the stash.

z k     (magit-stash-drop)

Remove a stash from the stash list. When the region is active, offer to drop all contained stashes.

z v     (magit-stash-show)

Show all diffs of a stash in a buffer.

z b     (magit-stash-branch)

Create and checkout a new BRANCH from STASH. The branch starts at the commit that was current when the stash was created.

z B     (magit-stash-branch-here)

Create and checkout a new BRANCH using magit-branch with the current branch or HEAD as the starting-point. Then apply STASH, dropping it if it applies cleanly.

z f     (magit-stash-format-patch)

Create a patch from STASH.

k     (magit-stash-clear)

Remove all stashes saved in REF’s reflog by deleting REF.

z l     (magit-stash-list)

List all stashes in a buffer.

User Option: magit-stashes-margin

This option specifies whether the margin is initially shown in stashes buffers and how it is formatted.

The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).


Previous: , Up: Manipulating   [Contents][Index]