使用“Lite”VCS和“完全”版本?
嘿伙计们。我有一个 Objective C 中的应用程序(使用 xcode),我想将其分为两个不同的版本——精简版和完整版。如果我分叉了主项目,VCS(即 GIT 或 SVN)可以解决这个问题吗?我不熟悉分叉的工作原理,但是我对主项目所做的任何更改是否会与分叉的精简版项目合并?
如果不是,什么系统最适合保持两个项目之间的代码同步?我的目标是尽可能保持自动化......
Hey guys. I have an app in Objective C (using xcode) that I would like to branch into two different versions-- lite and full. Would a VCS (ie GIT or SVN) work for this if I forked the main project? I'm not familiar with how forking works, but would any changes I make to the main project be merged with the forked lite project?
If not, what system would be best for keeping the code in sync between the two projects? My goal would be to keep this as automated as possible...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几乎所有 VCS 都支持分支,您可以使用它来“调味”您的产品。但请注意,很大程度上取决于您如何在文件级别实现更改。就我个人而言,我不会使用 VCS 来调味。 应用程序或构建级别的配置通常更容易维护。
但这里有两个示例说明事情可能会如何发展。
简单调味的示例:
在这种情况下您要传送的内容主要是在目录级别定义的。没有修改任何模块,只是添加或删除。这两个列表可以轻松地在构建文件中维护,也许根本不需要 VCS,但那是另一回事了。
调味变得困难的示例(反模式)(精简版分支中的一个源文件)
如果您在 GENERIC 代码中遇到错误,但仅在您的精简版分支内(因为该错误可能以某种方式连接)到你的精简版功能)你必须在精简版分支中修复并提交它。您必须选择合并(并与完整版本兼容)您的单个错误修复,或者根本不将其合并回完整版本。随着时间的推移,后一个选项会增加精简版和完整版之间的“差距”,这反过来又使得从“上游”完整版获得更新变得更加困难,以防万一那边有更大的发展。
C
Pretty much all VCS support branching which you can use for "flavoring" your product. But beware, alot depends on how you implement changes on the file-level. Personally I would not use VCS for flavoring stuff. Application- or buildlevel configuration is mostly easier to maintain.
But here two examples for how things might come out.
Example for easy flavoring:
What you are shipping in this case is mostly defined on directory-level. No module is modified but only added or removed. These two lists could be maintained in a build-file as easily, maybe requiering no VCS at all, but thats a different story.
Example for flavoring made hard (anti-pattern) (one source file in the lite-branch)
If you encounter a bug in GENERIC code but only within your lite-branch (because the bug may be somehow connected to your lite-functionality) you will have to fix and commit it in the lite-branch. You will have to either cherry-pick merge (and make compatible with the full-version) your single bugfix or not merge it back to the full version at all. The later option over time increases the "gap" between your lite and full version which in turn makes it harder to get updates from the "upstream"-full version in case of bigger developments on that side.
C
你可以使用其中任何一个。我最熟悉 svn,但我认为它们都有这个能力。
您将有一个主要分支和一个精简分支。
SVN 合并起来非常容易。解决冲突非常简单。
我敢打赌大多数人都会同意这是一个很好的工具。
You could use either. I'm most familial with svn, but I think they both have the capacity.
You would have a main and a lite branch.
SVN merges quite easily. Conflict resolution is quite simple.
I'm betting most will agree it's a good tool for this.