How can I edit / fix the last git commit's message?
Amending any message to your git or bit-bucket is quite easy. Normally sometime, a developer need to modify the last committed message in git/bit-bucket. Git command is providing easy commands to achieve this. Follow the below steps with attached screen shot and you can do this.
Just pull your working branch , where you want to modify the last commit. But, make sure you want to modify your last commit for the working branch.I have bit-bucket in this example post.
Command Syntax:-
Example , as per the attached screenshot. I have used the command prompt for this example. In the below example , I have updated the new message "Amending new message". Then, push (used -means --force) the message to git/bit-bucket. Use the below screenshot as reference.
Now, you can see in bit-bucket the last committed message. The last message I have modified , its reflecting.
Hope it will help you.
Amending any message to your git or bit-bucket is quite easy. Normally sometime, a developer need to modify the last committed message in git/bit-bucket. Git command is providing easy commands to achieve this. Follow the below steps with attached screen shot and you can do this.
Just pull your working branch , where you want to modify the last commit. But, make sure you want to modify your last commit for the working branch.I have bit-bucket in this example post.
Command Syntax:-
git commit --amend -m "Your Amend Message"Then use the below command to push your changes.
git push -f origin master
Example , as per the attached screenshot. I have used the command prompt for this example. In the below example , I have updated the new message "Amending new message". Then, push (used -means --force) the message to git/bit-bucket. Use the below screenshot as reference.
Bit-Bucket amend |
Now, you can see in bit-bucket the last committed message. The last message I have modified , its reflecting.
Bit-Bucket web view |
Hope it will help you.
- How to install Jboss Fuse on Linux ?
- How to install jd-gui (Java Decompiler with graphics mode)?
- How to install Jboss Developer Studio on Linux ?
- How to install SQL * PLUS client in linux ?
- How to create tag on github.
- How to install git plug-in in eclipse.
Good Post! Thank you so much for sharing the post, it was so good to read and useful to improve
ReplyDeleteJava Training in Electronic City