[英]Should you have one Git repository or several when you have a project with web/ios/android applications?
In terms of organizing a new project, what are the pros/cons of having one Git repository with subdirectories for web/ios/android/etc versus having independent repositories for each? 在组织一个新项目方面,有一个Git存储库与web / ios / android / etc的子目录相比,每个存储库有哪些独立存储库的优缺点是什么?
Any recommendations? 有什么建议?
Git doesn't provide easy way to checkout sub-directory from a repository. Git没有提供从存储库中检出子目录的简便方法。 That means if you have two teams working on android and ios version respectively every one of them will have to checkout code of the other team.
这意味着如果你有两个团队分别在android和ios版本上工作,那么每个团队都必须签出另一个团队的代码。
What's worse git log will be a complete mess as it'll contain commits from all of the applications. 更糟糕的是git log将是一个完整的混乱,因为它将包含来自所有应用程序的提交。 That might cause some troubles while creating and merging branches related to particular application as well.
这可能会在创建和合并与特定应用程序相关的分支时造成一些麻烦。
I don't see any good reason for having separate projects in the same git repository. 我没有看到在同一个git存储库中有单独项目的任何充分理由。
If you want to have some central repository where you can store additional stuff like docs or smth else that is related to the whole project and not one of the application you can create central repository and add repository of each application to it as git submodule . 如果你想拥有一些中央存储库,你可以在其中存储与整个项目相关的文档或其他东西,而不是其中一个应用程序,你可以创建中央存储库并将每个应用程序的存储库添加到它作为git子模块 。
If apps share common code in some way, you can think about separating apps into branches also. 如果应用程序以某种方式共享公共代码,您可以考虑将应用程序分成分支。 Anyway, not a single branch with tree for projects inside it
无论如何, 不是一个带有树的分支,用于其中的项目
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.