30 ms·
Your complaints seem like a very indirect way to get what you want. Perhaps it's git's fault for making these possibilities, but I didn't even know they exist.
by tieTYT 12y ago
Your complaints seem like a very indirect way to get what you want. Perhaps it's git's fault for making these possibilities, but I didn't even know they exist.
If you want to revert/reset a file, why don't you just use the reset command? That seems like a more direct way than using checkout.
If you want to create a new branch, why not use "git branch branch-name"? As another said, the "git checkout -b branch-name" is just shorthand for convenience.
I've been learning git over a mere 2 months (I came from svn), I'm finding its UI to be very pleasant.
As someone else said, that index/staging/cached situation is bad, though.
- pfranz 12y ago"If you want to revert/reset a file, why don't you just use the reset command? That seems like a more direct way than using checkout." Because that's what git tell you to do when you run "git status" # (use "git checkout -- <file>..." to discard changes in working directory)
- gecko 12y agoInteresting you should mention "git reset", because, depending on the options you give it, it either: * reverts one file * reverts all files * removes changes from the index, but doesn't otherwise change anything at all * moves your branch, without changing any files * moves your branch and changes all files This rather makes my point. "git checkout -b", meanwhile, is not a shorthand for "git branch something", but rather "git branch --track something origin/something", unless there is no "origin/something", in which case you are again correct.