git checkout master does not switch branch - repository broken?

前端 未结 4 482
太阳男子
太阳男子 2021-01-07 18:43

tl;dr: git checkout master does not switch to master branch, gives no error or any output at all and I have no clue why. Any other branch works

4条回答
  •  感动是毒
    2021-01-07 19:23

    The local master branch in your repository is not different from any other local branch in your repo. You cloned your repository to your development branch, which is the only local branch you have. Thus, if you try to checkout to your local master branch, git says it does not exist.

    If you want to have both development and master local branch initially the same, you can do one of these things:

    Download your repo to master branch, and create a local development branch:

    git clone 
    git checkout -b development
    

    or download your repo to development branch, and create a local master branch:

    git clone  --branch development
    git checkout -b master
    

提交回复
热议问题