简体   繁体   English

Git-处理文件已合并的合并

[英]Git - handling a merge where files have merged

The problem we're facing is simple, I'm just not sure how to properly handle it. 我们面临的问题很简单,我只是不确定如何正确处理它。 We have a branch that re-organized files and we're ready to merge master into that branch. 我们有重新组织文件一个分支,我们准备主合并到该分支。 The problem is that by now master has changed quite a bit. 问题在于,到目前为止,master已经发生了很大变化。

Ex: 例如:

Master:
- file1
- file2
- file3

Our branch:
- directory1/file1
- directort2/file2
- directroy3/file3

How do I tell git the new location of the files so that the auto-merge can work properly? 如何告诉git文件的新位置,以便自动合并可以正常工作?

Thanks. 谢谢。

You should always move files using the git mv command to ensure that the new file structure is tracked properly. 您应该始终使用git mv命令移动文件,以确保正确跟踪新文件结构。 git can handle the merging as long as it is aware of which files are which. git可以处理合并,只要它知道哪些文件是哪个即可。

I've run into this before and it can be a pain. 我以前遇到过这个问题,可能会很痛苦。 This isn't really a solution but one way to make it less painful is to frequently rebase the branch against the Master. 这并不是真正的解决方案,但减轻痛苦的一种方法是经常根据主服务器重新分配分支。

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

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