Resolve conflicts automatically with git-mergetool

江枫思渺然 提交于 2019-12-24 10:38:59

问题


Now i resolve few conflicts, and want retain only remote state.

If i try change my option: git merge --strategy-option theirs
I have getting, error: 'merge' is not possible because you have unmerged files.

Of course, i can cancel my changes (for use command above), but then i will lose my changes.

Now, me offering run vimdiff: {local}: modified file {remote}: modified file Hit return to start merge resolution tool (vimdiff):

How i can retain only remote state. If file not exist - it easy (offer push the button).

Thanks.


回答1:


Use the git checkout command to set the working tree to match the remote stage (3):

git checkout -3 PATHS...

Or the local stage (2):

git checkout -2 PATHS...

Then add the files and commit to complete the merge.

Use git checkout -h if you forget which one is 2 and 3.



来源:https://stackoverflow.com/questions/28782210/resolve-conflicts-automatically-with-git-mergetool

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