I followed the steps from Change old commit message on Git, and I confirmed the commit message updated in git log
. But when I click the "Commit History" tab in Github, I still see the old message and old SHA-1.
So, I blindly tried git push origin master
, but that failed with:
To git@github.com:foobar.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:foobar.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
The error tells me to "merge with remote changes before pushing again", but that seems like the wrong thing to do: merging new stuff into an amended commit (from an older base). I'm confused.
How can I commit my amended message?