3 ms·
Isn't a bit off? It shows "git diff" as a diff between staging and workspace when it should be between workspace and local repo.
by rinchik 7y ago
Isn't a bit off? It shows "git diff" as a diff between staging and workspace when it should be between workspace and local repo.
- mettamage 7y agoWhoops, I think you're right. I skimmed over git diff, as when I use git diff I constantly re-figure out for what it precisely applies again. I just care to remember "it diffs".
- pjc50 7y agoNot quite: if you stage something, it no longer appears in "git diff" and you have to use "git diff --cached" to show it. One of those things which I trip over occasionally. "git diff --cached" = staging vs. HEAD "git diff" = workspace vs. staging (but when nothing is staged, staging == HEAD) (I think?)
- rinchik 7y agoYep. you are right, "but when nothing is staged, staging == HEAD" is exactly what i had in mind
- ethomson 7y agoNo, this slide is correct. git diff (without any arguments) shows you what you haven't staged. In other words, the different between the working folder (which here is called "workspace") and the index.