Skip to content

GitHub – changing git commit message after push

This article helps you how can change Commit Message Or Author Name after push on GitHub.

  1. git rebase -i <commit hash you want to change>^
  2. For any commit, you wish to change the message, change pick to reword.
  3. Save and quit (in vi: :wq).
  4. For each such commit, you’ll get an editor to edit the commit message. Change it as you see fit, save and quit.

    Once you’re done editing all the commit messages, you’ll return to the command prompt, and have a new tree with the updated messages.

  5. You can now upload them to GitHub by using git push origin --force.

If you just need to fix your last commit, you can replace steps 1 – 4 with git commit --amend.

Hope this helps. Thanks.

One Comment

  1. Like!! Really appreciate you sharing this blog post.Really thank you! Keep writing.

Leave a Reply

Your email address will not be published.

Share via
Copy link
Powered by Social Snap