简体   繁体   English

如何使 git 冲突文件以所需的方式排序以解决

[英]How to make git conflicted files ordered in desired way for solving

How can I make my conflicted files to come in desired order to resolve conflicts.如何使我的冲突文件以所需的顺序出现以解决冲突。
eg if I have 2 branches named foo and bar i want to merge foo into bar and git gives me conflicts as below例如,如果我有 2 个名为 foo 和 bar 的分支,我想将 foo 合并到 bar 中,而 git 给我的冲突如下

CONFLICT (content): Merge conflict in x.py
CONFLICT (content): Merge conflict in z.py
CONFLICT (content): Merge conflict in y.py
Automatic merge failed; fix conflicts and then commit the result.

here three files are conflicted, (x.py, y.py, z.py) if i use command如果我使用命令,这里三个文件是冲突的,(x.py,y.py,z.py)

git mergetool --tool=meld

meld tool will open a file always in alphabetical order ( here x, y then z) but i want to resolve conflict in the y, z, x order. meld 工具将始终按字母顺序打开文件(此处为 x、y 然后 z),但我想解决 y、z、x 顺序中的冲突。

Please let me know if anyone knows the solution or workaround.如果有人知道解决方案或解决方法,请告诉我。

Thanks谢谢

You can always pass the file names manually:您始终可以手动传递文件名:

git mergetool --tool=meld y.py
git mergetool --tool=meld z.py
git mergetool --tool=meld x.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM