Skip to content

Commit 7b8cd49

Browse files
trastgitster
authored andcommitted
Documentation/reset: separate options by mode
Remove all but -q from the OPTIONS section, and instead explain the options separated by usage mode, since they only apply to one each. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb59b7f commit 7b8cd49

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

Documentation/git-reset.txt

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,39 @@ git-reset - Reset current HEAD to the specified state
88
SYNOPSIS
99
--------
1010
[verse]
11-
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
1211
'git reset' [-q] [<commit>] [--] <paths>...
1312
'git reset' --patch [<commit>] [--] [<paths>...]
13+
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
1414

1515
DESCRIPTION
1616
-----------
17-
Sets the current head to the specified commit and optionally resets the
18-
index and working tree to match.
19-
20-
This command is useful if you notice some small error in a recent
21-
commit (or set of commits) and want to redo that part without showing
22-
the undo in the history.
23-
24-
If you want to undo a commit other than the latest on a branch,
25-
linkgit:git-revert[1] is your friend.
26-
27-
The second and third forms with 'paths' and/or --patch are used to
28-
revert selected paths in the index from a given commit, without moving
29-
HEAD.
17+
In the first and second form, copy entries from <commit> to the index.
18+
In the third form, set the current branch to <commit>, optionally
19+
modifying index and worktree to match. The <commit> defaults to HEAD
20+
in all forms.
21+
22+
'git reset' [-q] [<commit>] [--] <paths>...::
23+
This form resets the index entries for all <paths> to their
24+
state at the <commit>. (It does not affect the worktree, nor
25+
the current branch.)
26+
+
27+
This means that `git reset <paths>` is the opposite of `git add
28+
<paths>`.
3029

30+
'git reset' --patch|-p [<commit>] [--] [<paths>...]::
31+
Interactively select hunks in the difference between the index
32+
and <commit> (defaults to HEAD). The chosen hunks are applied
33+
in reverse to the index.
34+
+
35+
This means that `git reset -p` is the opposite of `git add -p` (see
36+
linkgit:git-add[1]).
3137

32-
OPTIONS
33-
-------
38+
'git reset' [--<mode>] [<commit>]::
39+
This form points the current branch to <commit> and then
40+
updates index and working tree according to <mode>, which must
41+
be one of the following:
42+
+
43+
--
3444
--soft::
3545
Does not touch the index file nor the working tree at all, but
3646
requires them to be in a good order. This leaves all your changed
@@ -59,22 +69,19 @@ OPTIONS
5969
the given commit. If a file that is different between the
6070
current commit and the given commit has local changes, reset
6171
is aborted.
72+
--
6273

63-
-p::
64-
--patch::
65-
Interactively select hunks in the difference between the index
66-
and <commit> (defaults to HEAD). The chosen hunks are applied
67-
in reverse to the index.
68-
+
69-
This means that `git reset -p` is the opposite of `git add -p` (see
70-
linkgit:git-add[1]).
74+
If you want to undo a commit other than the latest on a branch,
75+
linkgit:git-revert[1] is your friend.
76+
77+
78+
OPTIONS
79+
-------
7180

7281
-q::
7382
--quiet::
7483
Be quiet, only report errors.
7584

76-
<commit>::
77-
Commit to make the current HEAD. If not given defaults to HEAD.
7885

7986
DISCUSSION
8087
----------

0 commit comments

Comments
 (0)