如何组织相关的应用程序到git repo的? [英] How to Organize related applications into git repo's?

查看:136
本文介绍了如何组织相关的应用程序到git repo的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是决策树,知道什么时候将一组相关和/或连贯的应用程序拆分为git repo和/或分支?我应该保持每个应用程序在回购?或所有应用程序&依赖在一个单一的repo?或者介于两者之间的东西?

What is the decision tree to know when to split a suite of related and/or cohesive applications into git repo's and/or branches? Should I keep each app in a repo? Or all app's & dependencies in a single repo? Or something in-between?

answer 如何使用git组织多个相关的应用程序?声称每个项目的存储库是合适的,但是没有给出关于项目是什么的线索。

answer How should I organize multiple related applications using git? claims that a repository per project is appropriate, but does not give clues as to what a project would be.

然后,当git repo被拆分时,就有了开发,测试,集成测试和生产检查的问题。回答如何组织您的编程工作列出一些分支/标记选项,但忽略了多应用程序的详细信息。

And then there's the question of dev, test, integration test, and production checkouts when the git repo's are split. Answer how do you organize your programming work lists some branch/tag options, but ignores the multi-app details.

还有DB模式!该模式的增量定义有帮助,但是,如果DB跨越后端和前端应用程序,那么在哪里可以保留此定义?

There's also the DB schema! incremental definition of the schema helps, but again, where would one keep this definition if the DB spans back-end and front-end app's?

思考:


  1. 一个前端网络应用程序,它的后端CGI / DB:一个或两个仓库?

  2. 一组使用其他后端功能的网络后端

  3. 一组共享CSS和jquery插件的前端应用程序

  4. 在前端应用程序库或依赖代码repo中测试前端功能的依赖代码的selenium脚本?

  1. a front-end web app and it's back-end CGI/DB: one repo or two?
  2. a set of web back-ends that use features from other back-ends
  3. a set of front-end app's that share CSS and jquery plug-ins
  4. selenium scripts that test front-end features across dependent code - in the front-end app repo or the dependent code repo?

如果我想在单个应用程序上工作,很难(好,乏味和容易出错)检查一个目录的repo,所以我必须检查出整个git树(或至少克隆整个树),所以这意味着git并不真正建立保持所有的应用程序的&

If I want to work on a single app, it's hard (well, tedious and error prone) to check out a directory of a repo, so I have to check out the entire git tree (or at least clone the whole tree), so that implies that git is not really built for keeping all the app's & dependencies in a single tree.

但是如果我想保留每个项目(应用程序,框架,依赖项,doc树,CSS)在它自己的repo,运行到追逐我的尾部依赖解析,也就是说,我不知道每个应用程序的哪个版本是兼容的。我认为git标签是一个很好的方法,如果只有我可以移动到更新的版本,保持兼容性。

But if I want to keep each of the projects (app's, frameworks, dependencies, doc trees, CSS) in it's own repo, then I run into chasing my tail for dependency resolution, that is, I don't know which version of each app are compatible. I think git tags are a good way to go, if only I could move them to newer versions that maintain compatibility.

当应用程序分裂或合并 - 重构模型下到baser模型 - 我可以移动git历史的只是那些文件到另一个git?我不知道如何做到这一点,所以倾向于一个单一的回购。

When app's split or merge -- as happens often with refactoring models down to baser models -- can i move the git history of just those files to another git? I don't see how to do this, so that leans towards a single repo for it all.

如果我开发一个新的功能跨应用程序,这将是很好的

If I develop a new feature across app's, it would be nice for branches to represent features.

推荐答案

我想我想要一个repo的仓库吗?解决方案

解决方案

这是关于使用组件方法:组件是一组连贯的文件,它们有自己的历史(自己的分支,标签和合并集)。 >
它应该只包括不能生成的(虽然有时可以将数据库模式添加到repo,如在GIT中处理Rails db / schema.rb文件的正确方法是什么?你仍然可以生成它,如在git中管理 schema.rb 的首选方法是什么?,以避免不必要的冲突

This is about using a component approach: a component being a coherent set of files which have their own history (own set of branches, tags and merges).
It should include only what cannot be generated (although the db schema can sometime be added to the repo, as seen in "What is the right approach to deal with Rails db/schema.rb file in GIT?". You still can generate it though, as shown in "What is the preferred way to manage schema.rb in git?", to avoid needless conflicts)

一个组件可以演变,没有另一个必须演变。请参见在git中构造相关组件

这是允许您回答问题的主要标准:X and Y:one or two repos?。

您可以 split a repo 进入两个,但是请注意,这将改变他们的历史:其他贡献者将需要重置自己的回购到新的历史。

A component can evolve without another one having to evolve. See "Structuring related components in git".
That is the main criteria which allows you to answer: "X and Y: one or two repos?".
You can split a repo into two later, but be aware that will change their history: other contributor will need to reset their own repo to that new history.

可以使用子模块将这些不同的组件库合并为一个,如在此解释(即repo of repos如果您只想拥有一个回购,请在子树,作为此处显示

You can group those different components repos in one with submodules, as explained here (that is the "repo of repos", or, if you want to have only one repo, in subtree, as illustrated here.

这篇关于如何组织相关的应用程序到git repo的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆