简体   繁体   English

当你有一个带有web / ios / android应用程序的项目时,你应该有一个Git存储库吗?

[英]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.

相关问题 当你有密钥时,让一个 Git 项目开源 - Making a Git project open source when you have secret keys Git克隆:“您似乎克隆了一个空存储库” - Git clone: "You appear to have cloned an empty repository" Git 克隆:删除警告“您似乎克隆了一个空存储库” - Git clone: remove warning "you appear to have cloned an empty repository" 当您的项目文件夹中包含以前的.git文件时,如何设置bitbucket? - How to set up bitbucket when you have a project folder with previous .git files? 当您已有本地副本时,如何初始化git子模块? - How to initialize git submodule when you already have a local copy? 具有“请确保您具有正确的访问权限并且存储库存在”的git review失败 - git review fails w/ “Please make sure you have the correct access rights and the repository exists” git pull 请确保您具有正确的访问权限并且存储库存在 - git pull Please make sure you have the correct access rights and the repository exists 您是否有一个示例git存储库,其中即将出现非平凡的合并冲突? - Do you have an example git repository with impending non-trivial merge conflicts? Git 错误:“请确保您拥有正确的访问权限并且存储库存在” - Git error: "Please make sure you have the correct access rights and the repository exists" git clone - 我怎么压制“你似乎克隆了一个空的存储库”警告? - git clone - how do I supress the “You appear to have cloned an empty repository” warning?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM