This is a related question to How do I edit git’s history to correct an incorrect email address/name. Using git rebase -i <first commit>, git commit --amend --author "Foo <foo@example.com>", and git rebase --continue, I was able to fix the logs for all of the commits but the first one. How do I fix the first commit?

1 Answer 1


After much trial and error, the following recipe was found to work:

# tag the root-most commit so we can reference it
git tag root `git rev-list HEAD | tail -1`
# check it out on its own branch
git checkout -b new-root root
# amend the commit
git commit --amend
# now you've changed the commit message, so checkout the original branch again
git checkout @{-1}
# and rebase it onto your new root commit
git rebase --onto new-root root
# then nuke the temporary branch and tag we created
git branch -d new-root
git tag -d root

true credit should go to drizzd on #git for this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.