2 ms·
While I agree changing branches is the most common use-case for git checkout, it's far from the only "normal" one. The form that updates files to match revision
by mb7733 3y ago
While I agree changing branches is the most common use-case for git checkout, it's far from the only "normal" one. The form that updates files to match revisions is actually mentioned first in the man page:
DESCRIPTION
Updates files in the working tree to match the version in the index or the specified tree. If no pathspec
was given, git checkout will also update HEAD to set the specified branch as the current branch.
Now that `git switch` exists, one could argue that this is the main use case for `checkout` and the other one could be deprecated.