Skip to content

Commit 97e9a22

Browse files
jingxuegitster
authored andcommitted
replace reference to git-rm with git-reset in git-commit doc
The message in git-commit suggesting to use 'git rm --cached' to unstage is just plain wrong. It really should mention 'git reset'. Suggested by Jan Hudec. Signed-off-by: Jing Xue <jingxue@digizenstudio.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c05ef93 commit 97e9a22

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Documentation/git-add.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ See Also
224224
--------
225225
gitlink:git-status[1]
226226
gitlink:git-rm[1]
227+
gitlink:git-reset[1]
227228
gitlink:git-mv[1]
228229
gitlink:git-commit[1]
229230
gitlink:git-update-index[1]

Documentation/git-commit.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,13 @@ EXAMPLES
154154
--------
155155
When recording your own work, the contents of modified files in
156156
your working tree are temporarily stored to a staging area
157-
called the "index" with gitlink:git-add[1]. Removal
158-
of a file is staged with gitlink:git-rm[1]. After building the
159-
state to be committed incrementally with these commands, `git
160-
commit` (without any pathname parameter) is used to record what
157+
called the "index" with gitlink:git-add[1]. A file can be
158+
reverted back, only in the index but not in the working tree,
159+
to that of the last commit with `git-reset HEAD -- <file>`,
160+
which effectively reverts `git-add` and prevents the changes to
161+
this file from participating in the next commit. After building
162+
the state to be committed incrementally with these commands,
163+
`git commit` (without any pathname parameter) is used to record what
161164
has been staged so far. This is the most basic form of the
162165
command. An example:
163166

0 commit comments

Comments
 (0)