We all do mistakes and sometimes by mistake we had committed a wrong commit message in Git. So, if you want to edit your last commit message, you have to execute -
git commit --amend
That will take you to the text editor and let you change the last commit message. In addition to this you can set the commit message directly in the command line
git commit --amend -m "new message"
Now if you want to overwrite the files as well you can use
git commit -a --amend -m "new message"
If you want to edit more than one messages you can use
git rebase -i Head~5.
As you can see I have used a number 5 after Head~ to specify how many commit messages I would like to change. In this case I am going to change 5 commit messages.
Please Like and Share the Blog, if you find it interesting and helpful.
git commit --amend
That will take you to the text editor and let you change the last commit message. In addition to this you can set the commit message directly in the command line
git commit --amend -m "new message"
Now if you want to overwrite the files as well you can use
git commit -a --amend -m "new message"
If you want to edit more than one messages you can use
git rebase -i Head~5.
As you can see I have used a number 5 after Head~ to specify how many commit messages I would like to change. In this case I am going to change 5 commit messages.
Please Like and Share the Blog, if you find it interesting and helpful.
Related articles
- Integrate Colorbox in Asp Net Web Application
- How to Integrate CKEditor in Asp Net Web Application
- Using UNC path for Storing and Retrieving Files in ASP Net
- Asp Net Interview Questions and Answers - Part 1
- HTTP Error 500.22 - Internal Server Error
- Asp.Net : How to regenerate .designer.cs file for aspx or ascx files
- Run .sql script file in C#
- How to improve Asp.Net Application Performance - Part 2
- How to improve Asp.Net Application Performance - Part 1
- Globals in Nodejs
No comments:
Post a Comment