OK, donc, de l'image, le scénario, j'étais dans un:
Vous tentez d'un merge
, ou peut-être un cherry-pick
, et vous êtes arrêté avec
$ git cherry-pick 1023e24
error: could not apply 1023e24... [Commit Message]
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'
Maintenant, vous affichez le fichier en conflit et que vous n'avez vraiment pas envie de garder vos modifications. Dans mon cas ci-dessus, le fichier a été en conflit à un juste un saut de ligne mon IDE a auto-ajoutée. Pour annuler vos modifications et d'accepter leur, de la façon la plus simple est:
git checkout --theirs path/to/the/conflicted_file.php
git add path/to/the/conflicted_file.php
L'inverse (pour remplacer la version entrante avec votre version) est
git checkout --ours path/to/the/conflicted_file.php
git add path/to/the/conflicted_file.php
Étonnamment, je n'arrivais pas à trouver cette réponse très facilement sur le Net.