|
9 | 9 | --------
|
10 | 10 | [verse]
|
11 | 11 | 'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
|
12 |
| - [--dry-run] [(-c | -C | --fixup | --squash) <commit>] |
| 12 | + [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)] |
13 | 13 | [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
|
14 | 14 | [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
|
15 | 15 | [--date=<date>] [--cleanup=<mode>] [--[no-]status]
|
@@ -86,11 +86,44 @@ OPTIONS
|
86 | 86 | Like '-C', but with `-c` the editor is invoked, so that
|
87 | 87 | the user can further edit the commit message.
|
88 | 88 |
|
89 |
| ---fixup=<commit>:: |
90 |
| - Construct a commit message for use with `rebase --autosquash`. |
91 |
| - The commit message will be the subject line from the specified |
92 |
| - commit with a prefix of "fixup! ". See linkgit:git-rebase[1] |
93 |
| - for details. |
| 89 | +--fixup=[(amend|reword):]<commit>:: |
| 90 | + Create a new commit which "fixes up" `<commit>` when applied with |
| 91 | + `git rebase --autosquash`. Plain `--fixup=<commit>` creates a |
| 92 | + "fixup!" commit which changes the content of `<commit>` but leaves |
| 93 | + its log message untouched. `--fixup=amend:<commit>` is similar but |
| 94 | + creates an "amend!" commit which also replaces the log message of |
| 95 | + `<commit>` with the log message of the "amend!" commit. |
| 96 | + `--fixup=reword:<commit>` creates an "amend!" commit which |
| 97 | + replaces the log message of `<commit>` with its own log message |
| 98 | + but makes no changes to the content of `<commit>`. |
| 99 | ++ |
| 100 | +The commit created by plain `--fixup=<commit>` has a subject |
| 101 | +composed of "fixup!" followed by the subject line from <commit>, |
| 102 | +and is recognized specially by `git rebase --autosquash`. The `-m` |
| 103 | +option may be used to supplement the log message of the created |
| 104 | +commit, but the additional commentary will be thrown away once the |
| 105 | +"fixup!" commit is squashed into `<commit>` by |
| 106 | +`git rebase --autosquash`. |
| 107 | ++ |
| 108 | +The commit created by `--fixup=amend:<commit>` is similar but its |
| 109 | +subject is instead prefixed with "amend!". The log message of |
| 110 | +<commit> is copied into the log message of the "amend!" commit and |
| 111 | +opened in an editor so it can be refined. When `git rebase |
| 112 | +--autosquash` squashes the "amend!" commit into `<commit>`, the |
| 113 | +log message of `<commit>` is replaced by the refined log message |
| 114 | +from the "amend!" commit. It is an error for the "amend!" commit's |
| 115 | +log message to be empty unless `--allow-empty-message` is |
| 116 | +specified. |
| 117 | ++ |
| 118 | +`--fixup=reword:<commit>` is shorthand for `--fixup=amend:<commit> |
| 119 | +--only`. It creates an "amend!" commit with only a log message |
| 120 | +(ignoring any changes staged in the index). When squashed by `git |
| 121 | +rebase --autosquash`, it replaces the log message of `<commit>` |
| 122 | +without making any other changes. |
| 123 | ++ |
| 124 | +Neither "fixup!" nor "amend!" commits change authorship of |
| 125 | +`<commit>` when applied by `git rebase --autosquash`. |
| 126 | +See linkgit:git-rebase[1] for details. |
94 | 127 |
|
95 | 128 | --squash=<commit>::
|
96 | 129 | Construct a commit message for use with `rebase --autosquash`.
|
|
0 commit comments