xcode – Git,XIBs,合并

我正要在master分支上启动一个git分支,为我的应用程序添加一些功能,这也会涉及到界面的一些补充.

但是,我已经有一个分支用于其他一些功能,这些功能也涉及一些接口添加.

当我完成它们时,我是否能够将这些分支合并为主?是否有一些好的做法可能会以某种方式构建xib文件,以便以后合并?

解决方法

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.
只有在手动合并解析期间,您错误地保留了额外的选项卡定义时,才会有4个选项卡.

有关合并解决方案的精彩文章,请参阅Painless Merge Conflict Resolution in Git.

话虽如此,特别是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.

在发生冲突的情况下添加合并解决方案之前,这将为您留下额外的步骤,在XCode4编辑器中打开修改后的.xib文件,并检查一切是否仍然良好.

视觉检查完成后,record the merge resolution through rerere,将来have potentially automatic resolution.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...