@matheusbsbs / matheus-bagliano / commits / d537c7492b
Fork 0

git-reset.txt: make modes description more consistent

Currently, the structure of the individual mode entries is different which makes it difficult to grasp the differences between the modes. Also, the same items are named differently (e.g. <commit>, "the named commit", "the given commit", "the commit being switched to"). Structure and word all mode entries consistently. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael J Gruber committed Sep 15, 2010 at 22:47 UTC d537c7492b7d16bf439ace7e31f8a9c0a7b617c3
1 file changed +26 -17
Documentation/git-reset.txt
+26 -17
@@ -15,13 +15,13 @@ SYNOPSIS
15 DESCRIPTION
16 -----------
17 In the first and second form, copy entries from <commit> to the index.
18 -In the third form, set the current branch head to <commit>, optionally
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.
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 working tree, nor
24 + state at <commit>. (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
@@ -43,9 +43,10 @@ This means that `git reset -p` is the opposite of `git add -p` (see
43 linkgit:git-add[1]).
44
45 'git reset' [--<mode>] [<commit>]::
46 - This form resets the current branch head to <commit> and then
47 - updates index and working tree according to <mode>, which must
48 - be one of the following:
46 + This form resets the current branch head to <commit> and
47 + possibly updates the index (resetting it to the tree of <commit>) and
48 + the working tree depending on <mode>, which
49 + must be one of the following:
50 +
51 --
52 --soft::
@@ -60,22 +61,30 @@ linkgit:git-add[1]).
61 been updated. This is the default action.
62
63 --hard::
63 - Matches the working tree and index to that of the tree being
64 - switched to. Any changes to tracked files in the working tree
65 - since <commit> are lost.
64 + Resets the index and working tree. Any changes to tracked files in the
65 + working tree since <commit> are discarded.
66
67 --merge::
68 - Resets the index to match the tree recorded by the named commit,
69 - and updates the files that are different between the named commit
70 - and the current commit in the working tree.
68 + Resets the index and updates the files in the working tree that are
69 + different between <commit> and HEAD, but keeps those which are
70 + different between the index and working tree (i.e. which have changes
71 + which have not been added).
72 + If a file that is different between <commit> and the index has unstaged
73 + changes, reset is aborted.
74 ++
75 +In other words, --merge does something like a 'git read-tree -u -m <commit>',
76 +but carries forward unmerged index entries.
77
78 --keep::
73 - Reset the index to the given commit, keeping local changes in
74 - the working tree since the current commit, while updating
75 - working tree files without local changes to what appears in
76 - the given commit. If a file that is different between the
77 - current commit and the given commit has local changes, reset
78 - is aborted.
79 + Resets the index, updates files in the working tree that are
80 + different between <commit> and HEAD, but keeps those
81 + which are different between HEAD and the working tree (i.e.
82 + which have local changes).
83 + If a file that is different between <commit> and HEAD has local changes,
84 + reset is aborted.
85 ++
86 +In other words, --keep does a 2-way merge between <commit> and HEAD followed by
87 +'git reset --mixed <commit>'.
88 --
89
90 If you want to undo a commit other than the latest on a branch,