git checkout master does not switch branch - repository broken?

前端 未结 4 437
太阳男子
太阳男子 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:25

    If your repo has a folder or file name the same as a branch name then you will need to: git checkout xyz -- with the extra -- at the end. It tells git to use a branch or commit instead of trying to use a folder/file name.

    Found the answer on another stackoverflow post: Git change branch when file of same name is present

提交回复
热议问题