git checkout
command exists since the beginning of git
It is used for these things:
git checkout -b new-feature upstream/main
git checkout main
git checkout README.md
git checkout v1.0.0 -- README.md
git checkout
command confuses everyone who start using git
Why?
Because it mixes two concepts:
That's why new commands were added with Git 2.23 (August 2019, almost 5 years ago):
git restore can be used as a simple replacement on action on files.
the only noticeable changes between git switch and git checkout is that branch creation was done with git checkout -b name
while it's now git switch -c name
Источник: dev.to
Наш сайт является информационным посредником. Сообщить о нарушении авторских прав.
programming tutorial git