From the course: Use Git Like a Pro by Pearson
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Amend commits
From the course: Use Git Like a Pro by Pearson
Amend commits
Now, we know how to make a commit but let's see how we can amend a commit. So we can basically, we are going to do two things. We are going to be amending a commit message and second, we are going to be amending a file in the existing commit. Let's see how that looks. Let's go back to our Git video course repository. In the file one, I will change the text. It is amending commits, demo one. Let's make this commit, git add all and git commit, amend commit, demo one. Now, let's say I want to amend this commit message. First of all, I can check what the commit message is by checking into Git log. So this is my commit message for Amend Commit Demo 1. Let's say I want to change this commit message to something else. So I can use this command, git commit hyphen hyphen Amend, and then minus M, and this is new commit message. Now, let's check Git log and the commit message has been changed. Now, let's say I wanted to make another change in the same commit, but I forgot. Let's say I also…