From the course: Use Git Like a Pro by Pearson

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Use the Git diff command

Use the Git diff command

Let's quickly see what git diff command is. So this command tells you the differences between the current version of the files and your last commit. Let's see how this looks like. So let's say I change here log and functionality. Now, if I want to see what is the difference, then I can do git diff, and this will tell me what is the difference between my current changes from the last commit. So in the last commit, it was bug, but I have added login functionality. So it will tell with the green that you have made this change, but your previous commit had bug. There is another way, so I don't use diff command a lot because I prefer to use Visual Studio Code. So if you go to the source control again, and then just click on the file, and this will tell you that this was the previous change and this is the new change which you have added. But feel free to use git diff command. So it only compares with the last commit, but you can also compare with the more previous commits. Let's say, let's…

Contents