Git refusing to merge unrelated histories on rebase

后端 未结 23 2640
旧巷少年郎
旧巷少年郎 2020-11-22 08:30

During git rebase origin/development the following error message is shown from Git:

fatal: refusing to merge unrelated histories
Error redoing m         


        
23条回答
  •  醉梦人生
    2020-11-22 09:01

    When doing a git pull, I got this message fatal: refusing to merge unrelated histories for a repo module where I hadn't updated the local copy for a while.

    I ran this command just to refresh local from origin. I just wanted latest from remote and didn't need any local changes.

    git reset --hard origin/master
    

    This fixed it in my case.

提交回复
热议问题