¿Qué debo hacer cuando git revert aborta con un mensaje de error?


Está bien, así que a veces recibo un error cuando intento revertir una confirmación (con Git). Todo lo que hago es

git revert <commit hash>

Y me da este mensaje:

error: could not revert <commit hash> <commit message>
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'

¿Significa esto que debo usar git mergetool y resolver cualquier conflicto? Una vez que hago esto puedo agregar/rm y luego commit, y la reversión está completa?

Author: Paŭlo Ebermann, 2011-05-22

2 answers

Sí, tendrás que resolver los conflictos, marcarlos como tal con git add o git rm y git commit

El commit no está hecho todavía, después del git revert - si lo ves .git / MERGE_MSG, verás algo como:

Revert"adding revert"

Esto revierte commit c1366607f15a8384434948cb0bcbf8ece48bb460.

Conflictos:

Revertir

Así que una vez que haya resuelto la fusión y haga un git commit se le presentará el mensaje de la MERGE_MSG y puede confirmar y que completa la reversión.

 21
Author: manojlds,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-05-21 21:29:06

Puede usar git reset hard hard, si desea eliminar todos los conflictos y eliminar la reversión que ha hecho para la que surge el error de abortar.

 1
Author: ARKhan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-01 06:32:10