Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.56.0
2026-09-28
-
2.55.0
2026-06-29
-
2.54.0
2026-04-20
- 2.53.0 no changes
-
2.52.0
2025-11-17
- 2.51.1 → 2.51.2 no changes
-
2.51.0
2025-08-18
- 2.43.1 → 2.50.1 no changes
-
2.43.0
2023-11-20
- 2.42.1 → 2.42.4 no changes
-
2.42.0
2023-08-21
- 2.39.1 → 2.41.3 no changes
-
2.39.0
2022-12-12
- 2.38.1 → 2.38.5 no changes
-
2.38.0
2022-10-02
- 2.35.1 → 2.37.7 no changes
-
2.35.0
2022-01-24
- 2.32.1 → 2.34.8 no changes
-
2.32.0
2021-06-06
- 2.31.1 → 2.31.8 no changes
-
2.31.0
2021-03-15
- 2.26.1 → 2.30.9 no changes
-
2.26.0
2020-03-22
- 2.24.1 → 2.25.5 no changes
-
2.24.0
2019-11-04
- 2.23.1 → 2.23.4 no changes
-
2.23.0
2019-08-16
- 2.22.1 → 2.22.5 no changes
-
2.22.0
2019-06-07
- 2.17.1 → 2.21.4 no changes
-
2.17.0
2018-04-02
-
2.16.6
2019-12-06
- 2.15.4 no changes
-
2.14.6
2019-12-06
-
2.13.7
2018-05-22
-
2.12.5
2017-09-22
-
2.11.4
2017-09-22
- 2.8.6 → 2.10.5 no changes
-
2.7.6
2017-07-30
- 2.1.4 → 2.6.7 no changes
-
2.0.5
2014-12-17
SYNOPSIS
gitstashlist[<log-options>]gitstashshow[-u|--include-untracked|--only-untracked] [<diff-options>] [<stash>]gitstashdrop[-q|--quiet] [<stash>]gitstashpop[--index] [-q|--quiet] [<stash>]gitstashapply[--index] [-q|--quiet] [--label-ours=<label>] [--label-theirs=<label>] [--label-base=<label>] [<stash>]gitstashbranch<branchname> [<stash>]gitstash[push] [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet] [-u|--include-untracked] [-a|--all] [(-m|--message) <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>…]gitstashsave[-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet] [-u|--include-untracked] [-a|--all] [<message>]gitstashcleargitstashcreate[<message>]gitstashstore[(-m|--message) <message>] [-q|--quiet] <commit>gitstashexport(--to-ref<ref>) [<stash>…]gitstashimport<commit>
DESCRIPTION
Use git stash when you want to record the current state of the
working directory and the index, but want to go back to a clean
working directory. The command saves your local modifications away
and reverts the working directory to match the HEAD commit.
The modifications stashed away by this command can be listed with
git stash list, inspected with git stash show, and restored
(potentially on top of a different commit) with git stash apply.
Calling git stash without any arguments is equivalent to git stash push.
A stash is by default listed as "WIP on <branchname> …", but
you can give a more descriptive message on the command line when
you create one.
The latest stash you created is stored in refs/stash; older
stashes are found in the reflog of this reference and can be named using
the usual reflog syntax (e.g. stash@{0} is the most recently
created stash, stash@{1} is the one before it, stash@{2.hours.ago}
is also possible). Stashes may also be referenced by specifying just the
stash index (e.g. the integer <n> is equivalent to stash@{<n>}).
COMMANDS
push[-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [(-m|--message) <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]-
Save your local modifications to a new stash entry and roll them back to
HEAD(in the working tree and in the index). The <message> part is optional and gives the description along with the stashed state.For quickly making a snapshot, you can omit "push". In this mode, pathspec elements are only allowed after a double hyphen
--to prevent a misspelled subcommand from making an unwanted stash entry. save[-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]-
This option is deprecated in favour of git stash push. It differs from "stash push" in that it cannot take pathspec. Instead, all non-option arguments are concatenated to form the stash message.
list[<log-options>]-
List the stash entries that you currently have. Each stash entry is listed with its name (e.g.
stash@{0}is the latest entry,stash@{1}is the one before, etc.), the name of the branch that was current when the entry was made, and a short description of the commit the entry was based on.stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stashThe command takes options applicable to the git log command to control what is shown and how. See git-log[1].
show[-u|--include-untracked|--only-untracked] [<diff-options>] [<stash>]-
Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created. By default, the command shows the diffstat, but it will accept any format known to git diff (e.g.,
gitstashshow-pstash@{1}to view the second most recent entry in patch form). If no <diff-option> is provided, the default behavior will be given by thestash.showStat, andstash.showPatchconfig variables. You can also usestash.showIncludeUntrackedto set whether--include-untrackedis enabled by default. pop[--index] [-q|--quiet] [<stash>]-
Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse operation of
gitstashpush. The working directory must match the index.Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call
gitstashdropmanually afterwards.