Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Git First Commits File Status

Jan Lundeen
Jan Lundeen
5,886 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,886 Points

Thanks Kris! That's exactly what it was.