How do I reword the very first git commit message?
pcreux's gist has a good way to reword the first commit:
# You can't use rebase -i here since it takes the parent commit as argument.
# You can do the following though:
git checkout FIRST_COMMIT_SHA && git commit --amend && git rebase HEAD master
Do git rebase -i --root
(point to root
instead of pointing to a specific commit)
This way, the first commit is also included and you can just reword
it like any other commit.
The --root
option was introduced in Git v1.7.12
(2012). Before then the only option was to use filter-branch
or --amend
, which is typically harder to do.
Note: see also this similar question and answer.