FAQ: Basic Git Workflow - git diff


#1

This community-built FAQ covers the “git diff” exercise from the lesson “Basic Git Workflow”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development
Computer Science

Learn Git

FAQs on the exercise git diff

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

In exercise 6 it says " Notice the output:

  • “Harry Programmer and the Sorcerer’s Code: Scene 1” is in the staging area, as indicated in white." But its actually in green and red. Why?

#3

“Harry Programmer and the Sorcerer’s Code: Scene 1” is already in the staging area that’s why it’s indicated in white. If you have done any changes to that line, it will be marked in red or green.


#4

In the exercise, the last step says to “Add the changes to the staging area in Git. Recall that you will need to identify the file by its name.” What does that mean?


#5

You just have to use the name of the file that you are adding to the staging area. Your last line here should be:

$ git add scene-1.txt

because “scene-1.txt” is the file that you’re using and adding. If you didn’t identify the file by name, Git wouldn’t know what you want to add to the staging area.