我正准备从 master 分支开始一个 git 分支来为我的应用程序添加一些功能,这也涉及到对界面的一些添加。
但是,我已经有一些其他功能的分支,其中还涉及一些接口(interface)添加。
当我完成这些分支后,我能否将它们 merge 到 master 中?是否有一些好的做法,可能以某种方式构建 xib 文件,以便以后轻松 merge ?
最佳答案
What if I, for example, have a tab view with three tabs in one branch, and a tab view with three tabs in the other, and two of the tabs are the same, and one is not, will i get a four-tabbed tab view after the merge
您很可能会得到 a conflict ,如果修改行(涉及选项卡定义)相同。
只有在手动 merge 解决过程中,您错误地留下了额外的选项卡定义,您才会有 4 个选项卡。
参见 Painless Merge Conflict Resolution in Git获取有关 merge 解析的精彩文章。
也就是说,关于 xibs 具体来说,它的介绍看起来不错:
As of Interface Builder version 3, a new file format (with extension
.xib
) has been added, which is functionally identical to.nib
, except it is stored in a flat file, making it more suitable for storage in revision control systems and processing by tools such as diff.
但是this thread总结实际感受:
How is Git able to merge changes to XIBs?
The structure of an XIB isn't linear; there's no guarantee that you can just swap out portions of an XIB and wind up with a usable XIB.
Unless Git has an understanding of XIBs near Apple's, I don't see how merging could be guaranteed to work.
这会给您留下额外的步骤,在添加您的 merge 解决方案以防发生冲突之前,在您的 XCode4 编辑器中打开修改后的 .xib
文件并检查一切是否仍然正常。
完成目视检查后,record the merge resolution through rerere
, 你会 have potentially automatic resolution future 。
关于xcode - Git、XIB、 merge ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5435543/