logo image

How to switch branch in Git


1 Answer

11 months ago by

  1. If it is an existing branch run the following command to switch to branch

    git checkout <branch_name>
  2. If it's a new branch you want to create, run the following command

    git checkout -b <branch_name>
11 months ago by Megamind