GIT Tutorial for Beginners #8 | Compare Files in Git | Git Diff Command | Track your changes via Git

preview_player
Показать описание
This Git Project video to compare files with diff command is a part of my GIT Tutorial for Beginners Series.

In Part-8 of Git Tutorial, we will learn to compare and track files with the Git command "git diff".

The "git diff" command helps in tracking the changes we have made in files. It will show the difference between the current and the original file. It shows the changes made between commits and the working tree.

We can also say, "git diff" command is used in git to track the difference between the changes made on a file.

We will be making use of the git diff command as we will progress deeper into the course as defining everything in one place will not be feasible.

git diff

Note: Diff Command will produce the changes in all the files that are present. For the changes on some specific files only, type the name of the file after the command name.

"git diff" command compares staging area files to the working directory files like about us at staging are and at working directory may not be the same and having some difference and that difference we will get from "git diff" command.

We need to run the "git diff" command alone if we want to check all files that are changed in the working directory but not added to the Git staging area yet.

We need to run the "git diff --staged" command if we want to check all files that are changed in the staging area of Git.

To compare the specific file in Git at the working directory and staging area, we will use "git diff path/filename".

Other Popular Stack Developers Series that can help you:-

Follow Stack Developers on Social Media to get updates and resolve your queries
Рекомендации по теме
welcome to shbcf.ru