3 ms·
`git checkout` has one main responsibility: take stuff from a commit and put it on the filesystem (and put it in the index as well). All of its functionality i
by stouset 9y ago
`git checkout` has one main responsibility: take stuff from a commit and put it on the filesystem (and put it in the index as well).
All of its functionality is simple variants on that. `-b` is the only real odd man out, and it’s just a shortcut for calling `git branch $branchname` first.