Home Explore Blog CI



git

3rd chunk of `Documentation/git-stash.adoc`
855d46aad6565f5663cef5e95fec31d4e8d45e128570ea430000000100000fa1

drop [-q|--quiet] [<stash>]::

	Remove a single stash entry from the list of stash entries.

create::

	Create a stash entry (which is a regular commit object) and
	return its object name, without storing it anywhere in the ref
	namespace.
	This is intended to be useful for scripts.  It is probably not
	the command you want to use; see "push" above.

store::

	Store a given stash created via 'git stash create' (which is a
	dangling merge commit) in the stash ref, updating the stash
	reflog.  This is intended to be useful for scripts.  It is
	probably not the command you want to use; see "push" above.

OPTIONS
-------
-a::
--all::
	This option is only valid for `push` and `save` commands.
+
All ignored and untracked files are also stashed and then cleaned
up with `git clean`.

-u::
--include-untracked::
--no-include-untracked::
	When used with the `push` and `save` commands,
	all untracked files are also stashed and then cleaned up with
	`git clean`.
+
When used with the `show` command, show the untracked files in the stash
entry as part of the diff.

--only-untracked::
	This option is only valid for the `show` command.
+
Show only the untracked files in the stash entry as part of the diff.

--index::
	This option is only valid for `pop` and `apply` commands.
+
Tries to reinstate not only the working tree's changes, but also
the index's ones. However, this can fail, when you have conflicts
(which are stored in the index, where you therefore can no longer
apply the changes as they were originally).

-k::
--keep-index::
--no-keep-index::
	This option is only valid for `push` and `save` commands.
+
All changes already added to the index are left intact.

-p::
--patch::
	This option is only valid for `push` and `save` commands.
+
Interactively select hunks from the diff between HEAD and the
working tree to be stashed.  The stash entry is constructed such
that its index state is the same as the index state of your
repository, and its worktree contains only the changes you selected
interactively.  The selected changes are then rolled back from your
worktree. See the ``Interactive Mode'' section of linkgit:git-add[1]
to learn how to operate the `--patch` mode.
+
The `--patch` option implies `--keep-index`.  You can use
`--no-keep-index` to override this.

-S::
--staged::
	This option is only valid for `push` and `save` commands.
+
Stash only the changes that are currently staged. This is similar to
basic `git commit` except the state is committed to the stash instead
of current branch.
+
The `--patch` option has priority over this one.

--pathspec-from-file=<file>::
	This option is only valid for `push` command.
+
Pathspec is passed in `<file>` instead of commandline args. If
`<file>` is exactly `-` then standard input is used. Pathspec
elements are separated by LF or CR/LF. Pathspec elements can be
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
global `--literal-pathspecs`.

--pathspec-file-nul::
	This option is only valid for `push` command.
+
Only meaningful with `--pathspec-from-file`. Pathspec elements are
separated with NUL character and all other characters are taken
literally (including newlines and quotes).

-q::
--quiet::
	This option is only valid for `apply`, `drop`, `pop`, `push`,
	`save`, `store` commands.
+
Quiet, suppress feedback messages.

\--::
	This option is only valid for `push` command.
+
Separates pathspec from options for disambiguation purposes.

<pathspec>...::
	This option is only valid for `push` command.
+
The new stash entry records the modified states only for the files
that match the pathspec.  The index entries and working tree files
are then rolled back to the state in HEAD only for these files,
too, leaving files that do not match the pathspec intact.
+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].

<stash>::
	This option is only valid for `apply`, `branch`, `drop`, `pop`,
	`show` commands.
+

Title: Git Stash Options and Parameters
Summary
The git stash command has numerous options and parameters, including --all, --include-untracked, --only-untracked, --index, --keep-index, --patch, --staged, --pathspec-from-file, --pathspec-file-nul, --quiet, and others, which control the behavior of stash operations, such as stashing, applying, and dropping stash entries, as well as specifying pathspecs and configuring the treatment of untracked and ignored files.