Skip to content

Commit

Permalink
reset: update documentation to require only tree-ish with paths
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin von Zweigbergk authored and Junio C Hamano committed Jan 16, 2013
1 parent 3fde386 commit bf44142
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions Documentation/git-reset.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ git-reset - Reset current HEAD to the specified state
SYNOPSIS
--------
[verse]
'git reset' [-q] [<commit>] [--] <paths>...
'git reset' (--patch | -p) [<commit>] [--] [<paths>...]
'git reset' [-q] [<tree-ish>] [--] <paths>...
'git reset' (--patch | -p) [<tree-sh>] [--] [<paths>...]
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]

DESCRIPTION
-----------
In the first and second form, copy entries from <commit> to the index.
In the first and second form, copy entries from <tree-ish> to the index.
In the third form, set the current branch head (HEAD) to <commit>, optionally
modifying index and working tree to match. The <commit> defaults to HEAD
in all forms.
modifying index and working tree to match. The <tree-ish>/<commit> defaults
to HEAD in all forms.

'git reset' [-q] [<commit>] [--] <paths>...::
'git reset' [-q] [<tree-ish>] [--] <paths>...::
This form resets the index entries for all <paths> to their
state at <commit>. (It does not affect the working tree, nor
state at <tree-ish>. (It does not affect the working tree, nor
the current branch.)
+
This means that `git reset <paths>` is the opposite of `git add
Expand All @@ -34,9 +34,9 @@ Alternatively, using linkgit:git-checkout[1] and specifying a commit, you
can copy the contents of a path out of a commit to the index and to the
working tree in one go.

'git reset' (--patch | -p) [<commit>] [--] [<paths>...]::
'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]::
Interactively select hunks in the difference between the index
and <commit> (defaults to HEAD). The chosen hunks are applied
and <tree-ish> (defaults to HEAD). The chosen hunks are applied
in reverse to the index.
+
This means that `git reset -p` is the opposite of `git add -p`, i.e.
Expand Down
4 changes: 2 additions & 2 deletions builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

static const char * const git_reset_usage[] = {
N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
N_("git reset [-q] <commit> [--] <paths>..."),
N_("git reset --patch [<commit>] [--] [<paths>...]"),
N_("git reset [-q] <tree-ish> [--] <paths>..."),
N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
NULL
};

Expand Down

0 comments on commit bf44142

Please sign in to comment.