1)
Clone the repo to your machine.
#git clone https://github.com/sajuptpm/tools.git
2)
Find ID of the commit which comes just before the commit for which you want to change the message.
You can use the command "#git log -n 10" for that.
3)
Then use this command:
#git rebase -i commit_id
Your text editor will open with a file that lists all the commits which come after your selected commit_id, and in front of each commit there is the word "pick".
The commit for which you want to change the commit message, change "pick" to "reword" and save it.
Then a new file should pop up in your editor.There you can change the commit message and save it
4)
Force-push to remote repo.
#git push -f origin master
5)
Check github. It should be updated.
Clone the repo to your machine.
#git clone https://github.com/sajuptpm/tools.git
2)
Find ID of the commit which comes just before the commit for which you want to change the message.
You can use the command "#git log -n 10" for that.
3)
Then use this command:
#git rebase -i commit_id
Your text editor will open with a file that lists all the commits which come after your selected commit_id
The commit for which you want to change the commit message, change "pick" to "reword" and save it.
Then a new file should pop up in your editor.There you can change the commit message and save it
4)
Force-push to remote repo.
#git push -f origin master
5)
Check github. It should be updated.
this one very useful to me, thank you.
ReplyDelete