xcode - Git、XIB、 merge

标签 xcode git macos xib

我正准备从 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 解析的精彩文章。

3-way 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 文件并检查一切是否仍然正常。

XCode4 xib file Editor

完成目视检查后,record the merge resolution through rerere , 你会 have potentially automatic resolution future 。

关于xcode - Git、XIB、 merge ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5435543/

相关文章:

git - 在这种情况下选择哪个 SCM? Redmine+git 还是 Fossil 还是?

macos - Mac OS X HFS+ 中最长的路径名字符串

html - 不同屏幕尺寸的网站显示不同

ios - ios SDK的头文件在哪里? OSX 在哪里?

ios - 即使使用 UIModalPresentationOverFullScreen 也更改 UIStatusbarStyle

swift - 我如何在 Swift 4 中使用陀螺仪来获得偏航角?

ios - 如何检测之前是否显示过位置服务弹出窗口

git - pull 并替换现有文件

ios - 更改 Xcode 调试器变量 View 中显示的信息

git - 如何将特定提交推送到远程,而不是之前的提交?