git-commit: document --amend
The "--amend" option is used to amend the tip of the current branch. This documentation text was copied straight from the commit that implemented it. Some minor format tweaks for asciidoc were taken from work by Francis Daly in commit b0d08a5.. It looks good now also in the html page. [jc: amended further to follow the recommendation by Francis in commit 3070b60]. Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl> Signed-off-by: Junio C Hamano <junkio@cox.net>
Marco Roeland committed
Apr 5, 2006 at 22:28 UTC
ae5d8470f6b8e1abdef19bf033472c63fb72b735
1 file changed
+23
-1
Documentation/git-commit.txt
+23
-1
@@ -9,7 +9,8 @@ SYNOPSIS
9
--------
10
[verse]
11
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
12
- [-e] [--author <author>] [--] [[-i | -o ]<file>...]
12
+ [--no-verify] [--amend] [-e] [--author <author>]
13
+ [--] [[-i | -o ]<file>...]
14
15
DESCRIPTION
16
-----------
@@ -71,6 +72,27 @@ OPTIONS
72
commit log message unmodified. This option lets you
73
further edit the message taken from these sources.
74
75
+--amend::
76
+
77
+ Used to amend the tip of the current branch. Prepare the tree
78
+ object you would want to replace the latest commit as usual
79
+ (this includes the usual -i/-o and explicit paths), and the
80
+ commit log editor is seeded with the commit message from the
81
+ tip of the current branch. The commit you create replaces the
82
+ current tip -- if it was a merge, it will have the parents of
83
+ the current tip as parents -- so the current top commit is
84
+ discarded.
85
++
86
+It is a rough equivalent for:
87
++
88
+------------
89
+ $ git reset --soft HEAD^
90
+ $ ... do something else to come up with the right tree ...
91
+ $ git commit -c ORIG_HEAD
92
+------------
93
++
94
+but can be used to amend a merge commit.
95
+
96
-i|--include::
97
Instead of committing only the files specified on the
98
command line, update them in the index file and then