How to change pushed commit messages

checkout to the respective branch where you need to change commit titles..

git rebase -i HEAD~3 or 4 – depends on how many you need to check.

Goto the respective line or commit id where you need to change..

press ‘i’ – to insert

change ‘pick’ to ‘r’ – desired commit you would like to

change your commit message..

press esc button and type “:wq” and hit enter

After rebasing successfully..check log by ‘git log -n 3’ to see your changes. come out of this command by pressing ‘q’.

Now do ‘git fetch’ followed by ‘git merge’. Do not forget to press ‘i’ and esc + ‘:wq’

Finally git push origin HEAD

All the best

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s