Re:Git Internals, Techniques, and Rewriting History
by rinchik on Monday October 21, 2019 @06:20AM
(#21310674)
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.
[ Parent
| on HN ]
Re:Git Internals, Techniques, and Rewriting History
by pjc50 on Monday October 21, 2019 @08:26AM
(#21311441)
Not 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?)
Re:Git Internals, Techniques, and Rewriting History
by rinchik on Monday October 21, 2019 @08:22PM
(#21319085)
Yep. you are right, "but when nothing is staged, staging == HEAD" is exactly what i had in mind
Re:Git Internals, Techniques, and Rewriting History
by ethomson on Monday October 21, 2019 @08:28AM
(#21311459)
No, 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.