Skip to content

Commit aa7b8c6

Browse files
carlosmngitster
authored andcommitted
Documentation/git-commit: reword the --amend explanation
The explanation for 'git commit --amend' talks about preparing a tree object, which shouldn't be how user-facing documentation talks about commit. Reword it to say it works as usual, but replaces the current commit. Signed-off-by: Carlos Martín Nieto <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1599999 commit aa7b8c6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Documentation/git-commit.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,15 @@ OPTIONS
190190
without changing its commit message.
191191

192192
--amend::
193-
Used to amend the tip of the current branch. Prepare the tree
194-
object you would want to replace the latest commit as usual
195-
(this includes the usual -i/-o and explicit paths), and the
196-
commit log editor is seeded with the commit message from the
197-
tip of the current branch. The commit you create replaces the
198-
current tip -- if it was a merge, it will have the parents of
199-
the current tip as parents -- so the current top commit is
200-
discarded.
193+
Replace the tip of the current branch by creating a new
194+
commit. The recorded tree is prepared as usual (including
195+
the effect of the `-i` and `-o` options and explicit
196+
pathspec), and the message from the original commit is used
197+
as the starting point, instead of an empty message, when no
198+
other message is specified from the command line via options
199+
such as `-m`, `-F`, `-c`, etc. The new commit has the same
200+
parents and author as the current one (the `--reset-author`
201+
option can countermand this).
201202
+
202203
--
203204
It is a rough equivalent for:

0 commit comments

Comments
 (0)