The easy way to push force the last commit in Git

When you want to push force to the last commit that you want to keep old message of that commit, you can use git --amend with --no-edit option.

Full git command:

$ git commit --amend --no-edit
$ git push -f


But, if you want to change the message of the last commit, just use -m "new message" instead --no-edit option:

$ git commit --amend -m "new message"
$ git push -f


© 2019 4codev

Created with love by Sil.