Learn to use the diff command to target changes that have been staged but not yet committed.
- [Speaker] In the previous movie, … we learned how to use git diff … to view the changes in our working directory. … In this movie, we will learn to view … changes with our staging index, only. … When we left off in the last movie, … we had made some changes to first file, … and third file, which we had not committed. … And if we go over here, and we're in our project, … we can then type git status and see those changes. … First file dot txt, and third file dot txt. … Now let's add our first file dot txt into staging. … We'll use git add with first file dot txt, … we're going to leave third file just in our working directory. … Now, let's type git diff. … You'll see that now when I type git diff, … it doesn't tell me about the first file's changes anymore. … It only tells me more about the changes in third file. … That's because git diff, by default, … compares the working directory against the staging tree. … If you want git diff to show you the changes … that are in the staging area, which there are there, …
- Exploring the history of version control
- Installing Git on Mac, Windows, and Linux
- Initializing a repository
- Writing useful commit messages
- The Git three-tree architecture
- Tracking when files are added, edited, deleted, or moved
- Viewing change sets and comparing versions
- Undoing changes and retrieving previous versions
- Ignoring changes to select files
Skill Level Beginner
1. What Is Git?
2. Install Git
3. Getting Started
4. Git Concepts and Architecture
5. Make Changes to Files
6. Use Git with a Real Project
7. Undo Changes
8. Ignore Files
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.