git / git-reference

Online Git Reference at http://git.github.io/git-reference/
Other
996 stars 363 forks source link

"git diff" instructions are quite confusing #6

Closed humitos closed 8 years ago

humitos commented 14 years ago

If you go forward the tutorial and get to http://gitref.org/basic/ following all the previous steps you will get different results in comparation with the tutorial.

I think that you need to run at least once "git commit" to be able to use these command "git diff HEAD" and "git diff --cached"

See you, thanks.

randomecho commented 11 years ago

Should be good as-is, doesn't seem like a step is missing.

When testing out the git diff --cached we're seeing the diff of a file ready to commit. Nothing currently in the working directory.

Then we continue on to the git diff HEAD section.

The intro mentions adding in extra changes, while not yet committing those already on the stage from the previous section.

So we now have changes to the one file in working directory, stage and HEAD (or the last commit).

brntbeer commented 8 years ago

Looks like @randomecho solved this yearrrrs ago. thanks again!