3 ms·
That isn't "git checkout <branch>", it is "git checkout <file>" If you try checking out another branch while you have uncommitted changes, git will tell you to
by bryondowd 12y ago
That isn't "git checkout <branch>", it is "git checkout <file>"
If you try checking out another branch while you have uncommitted changes, git will tell you to commit or stash your changes before changing branch.
I can certainly understand the danger/confusion there, though. Using checkout on a file reverts the file to a committed state. But the grandparent was referring to checking out a branch, not a file, which is safe.
- throwawayaway 12y agogit checkout <branch> * has the same behaviour. does it not? I left out the asterisk as I was working from memory.