Good work! Now you know how to add a file to the staging area.
Imagine that we type another line in scene-1.txt. Since the file is tracked, we can check the differences between the working directory and the staging area with:
git diff filename
filename is the actual name of the file. If the name of my file was changes.txt the command would be
git diff changes.txt
In the code editor, add this text to scene-1.txt:
Dumblediff: I should've known you would be here, Professor McGonagit.
From the terminal, use the new command to check the difference between the working directory and the staging area.
Notice the output:
- “Harry Programmer and the Sorcerer’s Code: Scene 1” is in the staging area, as indicated in white.
- Changes to the file are marked with a
+and are indicated in green.
Add the changes to the staging area in Git. Recall that you will need to identify the file by its name.