Git fetch a branch once with a normal name, and once with capital letter

前端 未结 2 604
暗喜
暗喜 2020-12-01 22:49

I\'m fetching for remote branches and stuck in some sort of a loop.

I fetch once and get:

$ git fetch
* [new branch]      minorRelease/something->         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 23:16

    @torek is right that it's caused by the difference of Linux and Windows. Linux is case-sensitive, while Windows is not. You can use ls-remote to show the branches in the server.

    git ls-remote --heads origin
    

    And I think in your case, the output should include the two branches with only the case of S different.

    ref/heads/minorRelease/Something
    ref/heads/minorRelease/something
    

    You can delete the remote branch if you find one of them is actually duplicated. And then do fetch again. It should be fine now.

    git push origin :minorRelease/Something
    git fetch
    

提交回复
热议问题