Git reference conflicts between branches (unable to update local branch)

后端 未结 2 898
忘了有多久
忘了有多久 2021-02-18 23:54

I\'m experiencing the following error while trying to git fetch a remote branch:

error: Ref refs/origin/remotes/my-branch is at s

相关标签:
2条回答
  • 2021-02-19 00:39

    For other googlers who get here: this is also another less drastic approach:

    Navigate to .git\refs\remotes\origin directory - delete the master file,

    Then do another git pull and it synchronizes successfully.

    0 讨论(0)
  • 2021-02-19 01:00

    I've found this error's cause:

    Someone has created another branch with the same name, but different case.

    What happened?

    Git for windows isn't case sensitive. So, things just got crazy! Git couldn't distinguish one from another, mistaking the hash of each's head.

    Solution:

    Just cut the evil by its root. Wrong remote branch was deleted and evererything is nice as ever.

    0 讨论(0)
提交回复
热议问题