Reword Specific Git Commit Message in Terminal on Mac - VicPhanDevOps/mac GitHub Wiki

• The following resolution is for rewording a specific Git commit.
image

• Type git rebase -i HEAD~< number of last commits > and press the return key to interactively rebase the desired number of previous commits.
image

• Pres the I key to get into INSERT mode.
image

• Replace pick with reword on the commit you wish to amend.
image

• Press the esc key to exit INSERT mode, type :wq and press the return key to save and exit the text editor.
image

• Press the I key to get into INSERT mode.
image

• Amend the previous commit message.
image

• Press the esc key to exit INSERT mode, type :wq and press the return key to save and exit the text editor.
image

• Type git log --oneline and press the return key to get the commit log and you’ll see that the previous commit has been reworded.
image

⚠️ **GitHub.com Fallback** ⚠️