Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 898 Bytes

git-amend.md

File metadata and controls

32 lines (21 loc) · 898 Bytes
date tags
2020-08-06
git

Using git amend

Amending the last commit message

  git commit --amend

Amending any other commit message

For example, if the commit message you want to modify is 4 commits back, then first REBASE your repository to the last 4 commit:

  git rebase -i HEAD~4

This will open up the commits in $EDITOR. Change the first word on the line which corresponds to the commit you want to modify from pick to reword.

Then modify the commit message as required.

Finally git push --force to send your amended commits upstream.

Reference: