GIT:使用 netbeans 合并两个分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9264264/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:28:29  来源:igfitidea点击:

GIT: Merge two branches using netbeans

gitversion-controlnetbeansmergebranch

提问by Anyul Rivas

I have two branchescreated at Bitbucket, one called masterand another called modulo-contratos.

我在Bitbucket创建了两个分支,一个称为master,另一个称为 modulo-contratos

The thing is that the second branch has changes in some files that I need to integrate into master, but when I do a mergeusing Netbeansfor it, it replaces my newest files in masterwith the older ones from the modulo-contratosbranch.

问题是第二个分支在一些我需要集成到master 的文件中发生了变化,但是当我使用Netbeans 对其进行合并时,它将master 中的最新文件替换为modulo-contratos分支中的旧文件。

What could I do?

我能做什么?

回答by Aaron Digulla

For git, the files from modulo-contratosmust look "newer" than the ones in master. You probably edited them in the modulo-contratosbranch after updating them in master.

对于 git,来自 .git 的文件modulo-contratos必须看起来“比master. 您可能modulo-contratosmaster.

You have several options:

您有多种选择:

  1. Try to checkout modulo-contratosand merge with master(instead of the other way around). That might give better results.

  2. Create a patch using the modulo-contratosbranch and apply that to master. After that, merge and revert all changed files by replacing them with the version that you had before. This way, your masterbranch will be clean and the "time stamps" will be reset for the next round (so this won't happen again).

  1. 尝试结帐modulo-contratos并与master(而不是相反)合并。这可能会产生更好的结果。

  2. 使用modulo-contratos分支创建补丁并将其应用于master. 之后,通过将它们替换为您之前拥有的版本来合并和还原所有更改的文件。这样,您的master分支将是干净的,并且下一轮的“时间戳”将被重置(因此这不会再次发生)。