git rebase fatal: Needed a single revision

后端 未结 6 1230
花落未央
花落未央 2020-12-12 23:04

I have a branch of a public repository and I am trying to update my branch with the current commits from the original repository:

$ git fetch 
         


        
6条回答
  •  离开以前
    2020-12-12 23:40

    The issue is that you branched off a branch off of.... where you are trying to rebase to. You can't rebase to a branch that does not contain the commit your current branch was originally created on.

    I got this when I first rebased a local branch X to a pushed one Y, then tried to rebase a branch (first created on X) to the pushed one Y.

    Solved for me by rebasing to X.

    I have no problem rebasing to remote branches (potentially not even checked out), provided my current branch stems from an ancestor of that branch.

提交回复
热议问题