Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Introduction to Git First Commits File Status

Jan Lundeen
Jan Lundeen
5,731 Points

On Challenge Task 5 of 6(Intro to Git), what is the option that will show the staged changes?

On Challenge Task 5 of 6(Intro to Git), I'm trying to find the option that will show the staged changes. Here's the question (below):

Run the "git diff" command again, but this time add the option that will show you the staged changes. (When you have the command right, changes to both the file that was previously tracked and the file that was previously untracked will be shown.)

I tried a couple of options. For example, I tried "git diff -- staged", but that wasn't right.

I also tried "git diff chapter1.txt", but that wasn't right either. Here's the error message I received:

Type in your command below, then press Enter. Bummer: All the files are staged, so "git diff" by itself won't produce any output! There's a command-line option you need to add to the "git diff" command..

I tried to find the command line option that will work, but I'm coming up blank. Any ideas?

Thanks,

Jan

1 Answer

git diff --staged

is correct. It looks like you have a space between -- and staged that should be removed. You can see this command @ 2:25 in the video

Jan Lundeen
Jan Lundeen
5,731 Points

Thanks Kris! That's exactly what it was.