3 ms·
> Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing
by aloknnikhil 6y ago
> Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about in order to fix your problem.
This is exactly why I have been running "git diff HEAD" instead of "git diff --staging" to diff my changes that have already been added to staging. I didn't even know that flag was a thing. I really wish there was some sort of an auto complete that could go from me describing the problem to the thing suggesting commands. Oh well, until then thanks for this!
- robbiemitchell 6y agoIn general the command line is like navigating a cave with a flashlight. I love the idea of some multi-line hinting system that shows you common paths.
- everybodyknows 6y agoNote that the two commands are not in general equivalent. Try `git add some-modified-file`, then change some line of the working file just "added". `git diff HEAD` will show the new change, whereas `git diff --staging` will not.
- AlexCoventry 6y agoPorcelains like magit are really great for discovering git's full capabilities.