理解 Meld 3 方式与 Git 合并
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12180523/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Understanding Meld 3 way merge with Git
提问by Naterade
My boss set up our new Git repository, one on our Windows server and one on our Linux Server.
我的老板建立了我们的新 Git 存储库,一个在我们的 Windows 服务器上,一个在我们的 Linux 服务器上。
I was asked to resolve our conflicts so I chose to use Meld.
我被要求解决我们的冲突,所以我选择使用 Meld。
When I run the first file it opens 3 windows;
当我运行第一个文件时,它会打开 3 个窗口;
- shipping.php.local.####,
- shipping.php
- shipping.remote.####
- Shipping.php.local.####,
- 运输.php
- 运输。远程。####
I have read the docs and help but I'm having trouble understanding. From what I can see, the shipping.remotehas the changes I made to the files on the Linux box that I want to keep. shipping.localare the files from the Windows server and the shipping.phpis the file that will result from the merge.
我已阅读文档并提供帮助,但我无法理解。据我所知,shipping.remote包含我对 Linux 机器上的文件所做的更改,我想保留这些文件。shipping.local是来自 Windows 服务器的文件,而shipping.php是合并后的文件。
So if I just take the code from the shipping.remote, move it to the middle file(shipping.php) and save it, I will have the updated file I want on the Git repository on the Linux box?
因此,如果我只是从shipping.remote 中获取代码,将其移动到中间文件(shipping.php)并保存它,我将在 Linux 机器上的 Git 存储库中拥有我想要的更新文件?
I hope I'm explaining correctly, I just don't want to mess something up.
我希望我解释正确,我只是不想把事情搞砸。
采纳答案by Greg
You understand correctly what are the files you see. But if you merge in a way you described (incorporate changes from remote to base), you will loose changes from local. In fact, you have to merge both local and remote into base. You could use Changes | Merge all non-conflicting and then resolve each conflict by hand.
您正确理解所看到的文件是什么。但是,如果您以您描述的方式合并(合并从远程到基础的更改),您将丢失本地的更改。实际上,您必须将本地和远程合并到 base 中。您可以使用 Changes | 合并所有非冲突,然后手动解决每个冲突。