GIT:使用 netbeans 合并两个分支
我在 Bitbucket 创建了两个分支,其中一个名为master 和另一个称为modulo-contratos。
问题是,第二个分支的某些文件发生了更改,我需要将这些文件集成到 master 中,但是当我使用 merge 时>Netbeans 对于它,它将 master 中的最新文件替换为 modulo-contratos< 中的旧文件/strong> 分支。
我能做什么?
I have two branches created at Bitbucket, one called master and another called 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 merge using Netbeans for it, it replaces my newest files in master with the older ones from the modulo-contratos branch.
What could I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 git,
modulo-contratos
中的文件必须看起来比master
中的文件“更新”。您可能在master
中更新它们后在modulo-contratos
分支中编辑了它们。您有多种选择:
尝试签出
modulo-contratos
并与master
合并(而不是相反)。这可能会产生更好的结果。使用
modulo-contratos
分支创建补丁并将其应用到master
。之后,合并并恢复所有更改的文件,将其替换为之前的版本。这样,您的master
分支将是干净的,并且下一轮的“时间戳”将被重置(因此这种情况不会再次发生)。For git, the files from
modulo-contratos
must look "newer" than the ones inmaster
. You probably edited them in themodulo-contratos
branch after updating them inmaster
.You have several options:
Try to checkout
modulo-contratos
and merge withmaster
(instead of the other way around). That might give better results.Create a patch using the
modulo-contratos
branch and apply that tomaster
. After that, merge and revert all changed files by replacing them with the version that you had before. This way, yourmaster
branch will be clean and the "time stamps" will be reset for the next round (so this won't happen again).