Git、XIB、合并
我正要从 master 分支启动一个 git 分支,以向我的应用程序添加一些功能,这也涉及到界面的一些添加。
但是,我已经有一个用于其他一些功能的分支,其中还涉及一些界面添加。
当我完成这些分支后,我能将它们合并到master吗?是否有一些好的做法,可能可以以某种方式构建 xib 文件,以便之后轻松合并?
I was just about to start a git branch off the master branch to add some functionality to my application, that would also involve some additions to the interface.
However, i already have a branch for some other functionality that also involves some interface additions.
Will i be able to merge both those branches to master when i finish with them? Is there some good practice to, probably, structure xib-files in a certain way that would make it easy to merge afterwards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您很可能会看到 冲突,如果修改行(涉及选项卡定义)相同。
仅当在手动合并解析过程中您错误地留下了额外的选项卡定义时,您才会有 4 个选项卡。
请参阅 Git 中的无痛合并冲突解决 一篇关于合并解析的精彩文章。
话虽这么说,关于xibs 具体来说,它的演示看起来不错:
但是这个帖子总结了实际的感受:
在添加合并解决方案(以防发生冲突)之前,您需要执行额外的步骤,在 XCode4 编辑器中打开修改后的 .xib 文件并检查一切是否仍然正常。
完成视觉检查后,通过
rerere
记录合并解析,您将将来可能会自动解决。You will most likely have a conflict, if the modified lines (involved in the tab definitions) are the same.
You will have 4 tabs only if, during the manual merge resolution, you mistakingly leave an extra tab definition.
See Painless Merge Conflict Resolution in Git for a great article on merge resolution.
That being said, regarding xibs specifically, its presentation seems good:
But this thread summarizes the actual feeling:
That would leave you with the extra step, before adding your merge resolution in case of conflict, to open the modified
.xib
file in your XCode4 editor and check if everything still looks good.Once that visual check is done, record the merge resolution through
rerere
, and you will have potentially automatic resolution in the future.当然,您可以将它们合并到 master 中。你如何构建文件并不重要,git 并不关心这一点。
Of course you will be able to merge them both into master. It doesn't matter how you structure your files, git doesn't care about that.