Help! I've Pushed To My Remote Repo, But I Need To Change My Git Commit Message!
So! Like the fool you are, you’ve entered
git push origin, only to realize, to your abject horror, that your commit message is incorrect. The shame! How embarrasing! How will you show your face around the foozeball table? Is this the end of your career?
Fear not, dear friend, for I have learned (one of) the secrets of
git commit --amend! (such poetry. the crowd sighs with delight.)
- From your terminal, enter
git commit --amend.
- Edit your commit message.
- Push your newly perfected commit to your remote branch.
Legends say you can event use
git commit --amend to change the very files that make up your commit. Astounding! Truly miraculous!
For more secrets, check out this great guide by Atlassian.