During a git rebase, how can I keep the original and discard changes?

大憨熊 提交于 2019-12-10 00:45:02

问题


I am doing a rebase and have come to a file with conflicts, but these conflicts are basically impossible to resolve. The best way to deal with the situation would be to tell git to ignore the changes and keep the original. I can then go back and re-edit the file to make the changes.

How can I do this?


回答1:


If you have encountered a merge conflict you can do this

git checkout --ours file

or the other way round

git checkout --theirs file


来源:https://stackoverflow.com/questions/8566272/during-a-git-rebase-how-can-i-keep-the-original-and-discard-changes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!