mirror of
https://github.com/git/git
synced 2024-10-02 14:45:21 +00:00
doc: reset: synchronize <pathspec> description
`git add` shows an example of good writing, follow it. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
24e4750c96
commit
d137b50756
|
@ -8,8 +8,8 @@ git-reset - Reset current HEAD to the specified state
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
[verse]
|
[verse]
|
||||||
'git reset' [-q] [<tree-ish>] [--] <paths>...
|
'git reset' [-q] [<tree-ish>] [--] <pathspec>...
|
||||||
'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]
|
'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]
|
||||||
'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
|
'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -19,23 +19,23 @@ In the third form, set the current branch head (`HEAD`) to `<commit>`,
|
||||||
optionally modifying index and working tree to match.
|
optionally modifying index and working tree to match.
|
||||||
The `<tree-ish>`/`<commit>` defaults to `HEAD` in all forms.
|
The `<tree-ish>`/`<commit>` defaults to `HEAD` in all forms.
|
||||||
|
|
||||||
'git reset' [-q] [<tree-ish>] [--] <paths>...::
|
'git reset' [-q] [<tree-ish>] [--] <pathspec>...::
|
||||||
This form resets the index entries for all `<paths>` to their
|
This form resets the index entries for all paths that match the
|
||||||
state at `<tree-ish>`. (It does not affect the working tree or
|
`<pathspec>` to their state at `<tree-ish>`. (It does not affect
|
||||||
the current branch.)
|
the working tree or the current branch.)
|
||||||
+
|
+
|
||||||
This means that `git reset <paths>` is the opposite of `git add
|
This means that `git reset <pathspec>` is the opposite of `git add
|
||||||
<paths>`. This command is equivalent to
|
<pathspec>`. This command is equivalent to
|
||||||
`git restore [--source=<tree-ish>] --staged <paths>...`.
|
`git restore [--source=<tree-ish>] --staged <pathspec>...`.
|
||||||
+
|
+
|
||||||
After running `git reset <paths>` to update the index entry, you can
|
After running `git reset <pathspec>` to update the index entry, you can
|
||||||
use linkgit:git-restore[1] to check the contents out of the index to
|
use linkgit:git-restore[1] to check the contents out of the index to
|
||||||
the working tree. Alternatively, using linkgit:git-restore[1]
|
the working tree. Alternatively, using linkgit:git-restore[1]
|
||||||
and specifying a commit with `--source`, you
|
and specifying a commit with `--source`, you
|
||||||
can copy the contents of a path out of a commit to the index and to the
|
can copy the contents of a path out of a commit to the index and to the
|
||||||
working tree in one go.
|
working tree in one go.
|
||||||
|
|
||||||
'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]::
|
'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]::
|
||||||
Interactively select hunks in the difference between the index
|
Interactively select hunks in the difference between the index
|
||||||
and `<tree-ish>` (defaults to `HEAD`). The chosen hunks are applied
|
and `<tree-ish>` (defaults to `HEAD`). The chosen hunks are applied
|
||||||
in reverse to the index.
|
in reverse to the index.
|
||||||
|
@ -101,6 +101,13 @@ OPTIONS
|
||||||
`reset.quiet` config option. `--quiet` and `--no-quiet` will
|
`reset.quiet` config option. `--quiet` and `--no-quiet` will
|
||||||
override the default behavior.
|
override the default behavior.
|
||||||
|
|
||||||
|
\--::
|
||||||
|
Do not interpret any more arguments as options.
|
||||||
|
|
||||||
|
<pathspec>...::
|
||||||
|
Limits the paths affected by the operation.
|
||||||
|
+
|
||||||
|
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
static const char * const git_reset_usage[] = {
|
static const char * const git_reset_usage[] = {
|
||||||
N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
|
N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
|
||||||
N_("git reset [-q] [<tree-ish>] [--] <paths>..."),
|
N_("git reset [-q] [<tree-ish>] [--] <pathspec>..."),
|
||||||
N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
|
N_("git reset --patch [<tree-ish>] [--] [<pathspec>...]"),
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue