首页 > 解决方案 > git 错误:`could not revert`,但没有详细信息

问题描述

我正在尝试git revert之前的提交。我收到此错误:

error: could not revert a135537... commit msg
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

没有列出任何冲突。我想也许我必须在一个新的工作目录中工作,所以我隐藏了所有新的更新,但仍然只是得到这个消息。有任何想法吗?

标签: git

解决方案


两者git cherry-pickgit revert都是 Git 内部的合并操作(请参阅Does git cherry-pick mean this?)。因此,它们可能会产生合并冲突。当他们这样做时,您必须解决这些合并冲突,然后使用git cherry-pick --continueorgit revert --continue来恢复操作。

应该在零件之前获得有关实际冲突的公告error: ...

如果您正在挑选或恢复单个提交,您可以使用 完成操作(在解决合并冲突之后)git commit,否则请确保使用正确的命令 with--continue以便操作继续执行任何剩余的提交以复制 ( cherry-pick) 或返回出(revert)。


推荐阅读