If you need to change the commit message after a push , it is possible !! let see the next example :

git commit --amend -m "New commit message"

Using the –amend we ask git to modify the last commit message. To confirm this modification we have to push :

git push --force origin <BRANCH-NAME>

This solution is working only if we need to modify the message of the last pushed commit and not an old commit !!

Also learn How To Switch Branch on Git ?


  1. Pingback: (SOLVED) Git - How to overwrite all commits on a branch ? » JavaTuto

Laisser un commentaire