cannot checkout remote git branch

后端 未结 3 1369
囚心锁ツ
囚心锁ツ 2021-02-05 10:09

I\'m in a github local clone. Below is the list of branches:

$ git branch -a
* master
  online-demo
  remotes/origin/HEAD -> origin/master
  remotes/origin/de         


        
相关标签:
3条回答
  • 2021-02-05 10:53

    You can try checking out the full SHA commit

    0 讨论(0)
  • 2021-02-05 11:13

    git checkout -b "name of branch"

    git pull origin "name of branch"

    0 讨论(0)
  • 2021-02-05 11:14

    You don't have any local branch called develop. When doing git checkout develop and no local branches are found, git will understand that you want to make a new local branch called develop, based on a develop branch in a remote repo, if any exists. In your case, you have 2 such branches origin/develop and pateketrueke/develop, so there is an ambiguity.

    You can be more explicit about it by using the following form:

    git branch develop origin/develop
    git checkout develop
    

    or

    git branch develop pateketrueke/develop
    git checkout develop
    

    depending on what you want.


    These can be abbreviated as:

    git checkout -b develop origin/develop
    

    or

    git checkout -b develop pateketrueke/develop
    
    0 讨论(0)
提交回复
热议问题