reset: update documentation to require only tree-ish with paths
When resetting with paths, we no longer require a commit argument, but only a tree-ish. Update the documentation and synopsis accordingly. Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin von Zweigbergk committed
Jan 16, 2013 at 10:00 UTC
bf44142f5464e913d99f9544787e59fc630f6cc9
2 files changed
+11
-11
Documentation/git-reset.txt
+9
-9
@@ -8,20 +8,20 @@ git-reset - Reset current HEAD to the specified state
8
SYNOPSIS
9
--------
10
[verse]
11
-'git reset' [-q] [<commit>] [--] <paths>...
12
-'git reset' (--patch | -p) [<commit>] [--] [<paths>...]
11
+'git reset' [-q] [<tree-ish>] [--] <paths>...
12
+'git reset' (--patch | -p) [<tree-sh>] [--] [<paths>...]
13
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
14
15
DESCRIPTION
16
-----------
17
-In the first and second form, copy entries from <commit> to the index.
17
+In the first and second form, copy entries from <tree-ish> to the index.
18
In the third form, set the current branch head (HEAD) to <commit>, optionally
19
-modifying index and working tree to match. The <commit> defaults to HEAD
20
-in all forms.
19
+modifying index and working tree to match. The <tree-ish>/<commit> defaults
20
+to HEAD in all forms.
21
22
-'git reset' [-q] [<commit>] [--] <paths>...::
22
+'git reset' [-q] [<tree-ish>] [--] <paths>...::
23
This form resets the index entries for all <paths> to their
24
- state at <commit>. (It does not affect the working tree, nor
24
+ state at <tree-ish>. (It does not affect the working tree, nor
25
the current branch.)
26
+
27
This means that `git reset <paths>` is the opposite of `git add
@@ -34,9 +34,9 @@ Alternatively, using linkgit:git-checkout[1] and specifying a commit, you
34
can copy the contents of a path out of a commit to the index and to the
35
working tree in one go.
36
37
-'git reset' (--patch | -p) [<commit>] [--] [<paths>...]::
37
+'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]::
38
Interactively select hunks in the difference between the index
39
- and <commit> (defaults to HEAD). The chosen hunks are applied
39
+ and <tree-ish> (defaults to HEAD). The chosen hunks are applied
40
in reverse to the index.
41
+
42
This means that `git reset -p` is the opposite of `git add -p`, i.e.
builtin/reset.c
+2
-2
@@ -23,8 +23,8 @@
23
24
static const char * const git_reset_usage[] = {
25
N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
26
- N_("git reset [-q] <commit> [--] <paths>..."),
27
- N_("git reset --patch [<commit>] [--] [<paths>...]"),
26
+ N_("git reset [-q] <tree-ish> [--] <paths>..."),
27
+ N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
28
NULL
29
};
30