Learn How to View Only Staged Changes in Git


show more Viewing only staged changes provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Viewing only staged changes

In the last movie we saw how we could use git diff to get details about the changes that were in our working directory. In this movie we are going to see how we can do the same thing with our staging index. Now the first thing, of course, we need to do is put something in our staging index, so let's do that with first_file.txt. We know how to do that with git add first_file.txt, now it's in our staging index. Git status will show us, first_file, those changes are now staged. The changes to third_file.txt are just in our working directory.

If we were to do a git diff now, it would just report the changes that are in our working directory. So when I told you earlier that it was comparing your working directory with the repository, that's not quite true, it's actually comparing it against the staging index and the repository. So it's things that are unique, things that are different about the working directory only. So what about those changes for first_file, how do we see those? We...

Viewing only staged changes
Video duration: 2m 28s 6h 25m Beginner

Viewers:

Viewing only staged changes provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...