Git 1.8: it push error: dst ref refs/heads/master receives from more than one src

后端 未结 5 1637
野趣味
野趣味 2021-02-18 17:43

Another issue with git 1.8:

$ git push
error: dst ref refs/heads/master receives from more than one src.
error: failed to push some refs to \'gitosis@xxx.xx:xxx.         


        
5条回答
  •  北海茫月
    2021-02-18 18:06

    Following what is explained in this git old patch (2007!)

    Some refs go stale, e.g. when the forkee rebased and lost some objects needed by the fork.
    The quick & dirty way to deal with those refs is to delete them and push them again.

    However, git-push first would first fetch the current commit name for the ref, would receive a null sha1 since the ref does not point to a valid object, then tell receive-pack that it should delete the ref with this commit name.
    delete_ref() would be subsequently be called, and check that resolve_ref() (which does not check for validity of the object) returns the same commit name. Which would fail.

    refs/heads/refs/heads/master looks like a branch improperly named "refs/heads/master" (using namespaces for defining hierachical branch name), and points to nothing.
    Deleting it was the right move.

提交回复
热议问题