git switch와 git checkout은 branch를 이동할 때 사용한다.
최근에는 branch 이동에는 switch를 더 많이 쓴다.
이미 존재하는 branch로 이동한다.
git switch <branch name>git switch mainbranch를 만들고 바로 이동한다.
git switch -c <branch name>git switch -c feature/login예전 방식으로 branch를 이동한다.
git checkout <branch name>git checkout devgit checkout -b <branch name>git checkout -b feature/logingit switch: branch 이동 목적git checkout: branch 이동 + 파일 복원 등 여러 용도- 초보자는 branch 이동에는
switch가 더 헷갈림이 적다
git switch main
git switch -c <branch name>
git checkout <branch name>
git checkout -b <branch name>