Error with git rebase (“could not apply…”)

后端 未结 2 1638
执念已碎
执念已碎 2021-01-30 10:55

I\'m the administrator of the GitHub repository https://github.com/plison/opendial. I would like to reduce the number of commits on the repository, since the repository already

2条回答
  •  粉色の甜心
    2021-01-30 11:15

    As a reminder to myself on how to resolve this:

    The error message is not very informative. If you type

    git rebase --continue
    

    you realize the error is because of a merge conflict that git cannot resolve by itself, and needs your help.

    To see what files have conflicts, type

    git status
    

    Resolve the merge conflicts in your favorite editor/IDE (hint: this should start with i and end with ntelliJ)

    Mark resolution with

    git add .
    

    If all the conflicts are resolved, you should see something like this:

    (all conflicts fixed: run "git rebase --continue")
    

    So continue your rebase with

    git rebase --continue
    

    Hopefully your rebase should now be successful

    git status
    

    shows:

    On branch feature/DIG-19302-Upgrade-mockito-v2
    Your branch is behind 'origin/feature/your-feature-branch' by 2 commits, and can be fast-forwarded.
    (use "git pull" to update your local branch)
    
    nothing to commit, working directory clean
    

    Don't do a git pull. If you do, you will only overwrite your merge conflicts. Instead push your merge conflict resolutions to the branch) with

    git push --force
    

    You're done! Your git log should show only 1 commit now (which is the forced update you just did)

提交回复
热议问题