How to switch branch in Git


1 Answer

6 years ago by

  1. If it is an existing branch run the following command to switch to branch
git checkout <branch_name>
  1. If it's a new branch you want to create, run the following command
git checkout -b <branch_name>
6 years ago by Karthik Divi