How can I switch to another branch in git?

后端 未结 9 753
难免孤独
难免孤独 2021-01-29 17:38

Which one of these lines is correct?

git checkout \'another_branch\'

Or

git checkout origin \'another_branch\'
         


        
9条回答
  •  终归单人心
    2021-01-29 18:22

    What worked for me is the following:

    Switch to the needed branch:

    git checkout -b BranchName
    

    And then I pulled the "master" by:

    git pull origin master
    

提交回复
热议问题