git rebase and deleted rebasing branches causing “Interactive rebase already started” error message

后端 未结 3 1505
再見小時候
再見小時候 2021-02-12 11:22

I was trying something out with a couple of branches so I rebased on a temporary branch and was in the middle of resolving some conflicts when I decided to not to complete the r

3条回答
  •  孤城傲影
    2021-02-12 12:15

    I just got a very similar error during an attempted rebase that did not fail. None of the tips above helped. Here's what I was seeing:

    $ git pull --rebase
    warning: refname 'xport1' is ambiguous.
    First, rewinding head to replay your work on top of it...
    Fast-forwarded xport1 to 98b787b0ea1f7f6771a5b1b56c7e8cc67b84c242.
    error: Ref refs/heads/xport1 is at 98b787b0ea1f7f6771a5b1b56c7e8cc67b84c242 but expected 3865d63ffb3a1a495363bfbd9ebb089e16152839
    fatal: Cannot lock the ref 'refs/heads/xport1'.
    Could not move back to refs/heads/xport1
    

    It turns out that if a reference name is ambigious, the rebase will fail, at least on git version 1.7.10.2 (Apple Git-33). I poked around and saw I had accidentally created a tag with the same name as the branch I was trying to rebase on. Deleting the tag got rid of this error.

提交回复
热议问题