Skip to content

Commit 2b7460d

Browse files
SyntevoAlexgitster
authored andcommitted
doc: stash: split options from description (1)
This patch moves blocks of text as-is to make it easier to review the next patch. Signed-off-by: Alexandr Miloslavskiy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5f393dc commit 2b7460d

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

Documentation/git-stash.txt

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,6 @@ non-option arguments are not allowed to prevent a misspelled
5858
subcommand from making an unwanted stash entry. The two exceptions to this
5959
are `stash -p` which acts as alias for `stash push -p` and pathspecs,
6060
which are allowed after a double hyphen `--` for disambiguation.
61-
+
62-
When pathspec is given to 'git stash push', the new stash entry records the
63-
modified states only for the files that match the pathspec. The index
64-
entries and working tree files are then rolled back to the state in
65-
HEAD only for these files, too, leaving files that do not match the
66-
pathspec intact.
67-
+
68-
If the `--keep-index` option is used, all changes already added to the
69-
index are left intact.
70-
+
71-
If the `--include-untracked` option is used, all untracked files are also
72-
stashed and then cleaned up with `git clean`, leaving the working directory
73-
in a very clean state. If the `--all` option is used instead then the
74-
ignored files are stashed and cleaned in addition to the untracked files.
75-
+
76-
With `--patch`, you can interactively select hunks from the diff
77-
between HEAD and the working tree to be stashed. The stash entry is
78-
constructed such that its index state is the same as the index state
79-
of your repository, and its worktree contains only the changes you
80-
selected interactively. The selected changes are then rolled back
81-
from your worktree. See the ``Interactive Mode'' section of
82-
linkgit:git-add[1] to learn how to operate the `--patch` mode.
83-
+
84-
The `--patch` option implies `--keep-index`. You can use
85-
`--no-keep-index` to override this.
8661

8762
save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
8863

@@ -128,14 +103,6 @@ pop [--index] [-q|--quiet] [<stash>]::
128103
Applying the state can fail with conflicts; in this case, it is not
129104
removed from the stash list. You need to resolve the conflicts by hand
130105
and call `git stash drop` manually afterwards.
131-
+
132-
If the `--index` option is used, then tries to reinstate not only the working
133-
tree's changes, but also the index's ones. However, this can fail, when you
134-
have conflicts (which are stored in the index, where you therefore can no
135-
longer apply the changes as they were originally).
136-
+
137-
When no `<stash>` is given, `stash@{0}` is assumed, otherwise `<stash>` must
138-
be a reference of the form `stash@{<revision>}`.
139106

140107
apply [--index] [-q|--quiet] [<stash>]::
141108

@@ -185,6 +152,41 @@ store::
185152
reflog. This is intended to be useful for scripts. It is
186153
probably not the command you want to use; see "push" above.
187154

155+
If the `--all` option is used instead then the
156+
ignored files are stashed and cleaned in addition to the untracked files.
157+
158+
If the `--include-untracked` option is used, all untracked files are also
159+
stashed and then cleaned up with `git clean`, leaving the working directory
160+
in a very clean state.
161+
162+
If the `--index` option is used, then tries to reinstate not only the working
163+
tree's changes, but also the index's ones. However, this can fail, when you
164+
have conflicts (which are stored in the index, where you therefore can no
165+
longer apply the changes as they were originally).
166+
167+
If the `--keep-index` option is used, all changes already added to the
168+
index are left intact.
169+
170+
With `--patch`, you can interactively select hunks from the diff
171+
between HEAD and the working tree to be stashed. The stash entry is
172+
constructed such that its index state is the same as the index state
173+
of your repository, and its worktree contains only the changes you
174+
selected interactively. The selected changes are then rolled back
175+
from your worktree. See the ``Interactive Mode'' section of
176+
linkgit:git-add[1] to learn how to operate the `--patch` mode.
177+
+
178+
The `--patch` option implies `--keep-index`. You can use
179+
`--no-keep-index` to override this.
180+
181+
When pathspec is given to 'git stash push', the new stash entry records the
182+
modified states only for the files that match the pathspec. The index
183+
entries and working tree files are then rolled back to the state in
184+
HEAD only for these files, too, leaving files that do not match the
185+
pathspec intact.
186+
187+
When no `<stash>` is given, `stash@{0}` is assumed, otherwise `<stash>` must
188+
be a reference of the form `stash@{<revision>}`.
189+
188190
DISCUSSION
189191
----------
190192

0 commit comments

Comments
 (0)