What should I do when git revert aborts with an error message?

前端 未结 2 1388
栀梦
栀梦 2020-12-03 02:47

OK, so I\'m getting an error sometimes when I try to revert a commit (with Git). All that I do is

git revert

and it gives me

相关标签:
2条回答
  • 2020-12-03 03:01

    You can use git reset --hard, if you want to delete all the conflicts and remove the revert you have done for which the abort error arise.

    0 讨论(0)
  • 2020-12-03 03:14

    Yes you will have to resolve the conflicts, mark them as so with git add or git rm and git commit

    The commit is not done yet, after the git revert - if you see .git/MERGE_MSG, you will see something like:

    Revert "adding revert"

    This reverts commit c1366607f15a8384434948cb0bcbf8ece48bb460.

    Conflicts:

    revert

    So once you resolved the merge and do a git commit you will be presented with the message from the MERGE_MSG file and you can commit and that completes the revert.

    0 讨论(0)
提交回复
热议问题