rebase in progress. Cannot commit. How to proceed or stop (abort)?

后端 未结 9 1267
鱼传尺愫
鱼传尺愫 2020-12-12 12:46

When I run:

git status

I see this:

rebase in progress; onto 9c168a5
You are currently rebasing branch \'master\' on \'9c1         


        
相关标签:
9条回答
  • 2020-12-12 13:12

    Rebase doesn't happen in the background. "rebase in progress" means that you started a rebase, and the rebase got interrupted because of conflict. You have to resume the rebase (git rebase --continue) or abort it (git rebase --abort).

    As the error message from git rebase --continue suggests, you asked git to apply a patch that results in an empty patch. Most likely, this means the patch was already applied and you want to drop it using git rebase --skip.

    0 讨论(0)
  • 2020-12-12 13:17

    You told your repository to rebase. It looks like you were on a commit (identified by SHA 9c168a5) and then did git rebase master or git pull --rebase master.

    You are rebasing the branch master onto that commit. You can end the rebase via git rebase --abort. This would put back at the state that you were at before you started rebasing.

    0 讨论(0)
  • 2020-12-12 13:19

    I got into this state recently. After resolving conflicts during a rebase, I committed my changes, rather than running git rebase --continue. This yields the same messages you saw when you ran your git status and git rebase --continue commands. I resolved the issue by running git rebase --abort, and then re-running the rebase. One could likely also skip the rebase, but I wasn't sure what state that would leave me in.

    $ git rebase --continue
    Applying: <commit message>
    No changes - did you forget to use 'git add'?
    If there is nothing left to stage, chances are that something else
    already introduced the same changes; you might want to skip this patch.
    
    When you have resolved this problem, run "git rebase --continue".
    If you prefer to skip this patch, run "git rebase --skip" instead.
    To check out the original branch and stop rebasing, run "git rebase --abort".
    
    $ git status
    rebase in progress; onto 4df0775
    You are currently rebasing branch '<local-branch-name>' on '4df0775'.
      (all conflicts fixed: run "git rebase --continue")
    
    nothing to commit, working directory clean
    
    0 讨论(0)
提交回复
热议问题