4 ms·
Argh -- good catch. You're right, `git checkout .` does the same thing as `git checkout -- .` (discard unstaged changes), and I'd been using the latter for a w
by SilasX 9y ago
Argh -- good catch. You're right, `git checkout .` does the same thing as `git checkout -- .` (discard unstaged changes), and I'd been using the latter for a while before I realized, so I usually use the longer one out of habit.
- kiallmacinnes 9y agoHey, it happens! I'm confident some of the flags I provide git daily do nothing meaningful either ;) Edit: I also googled it, as I thought up a reason why -- might be used. If I have a file called master, and want to unstage my changes to it, I would have to `git checkout master`. Given this command has multiple meanings, both of which could be appropriate, I'd need to disambiguate between them. The -- does exactly this, it prevents the tree-ish parsing.