使用gitignore来嵌套存储库。 [英] Use gitignore to nest repositories.

查看:189
本文介绍了使用gitignore来嵌套存储库。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想嵌套2 git回购。我一直在阅读子模块,有一段时间我认为它很棒,我想我可能想要别的东西。这是我的情况:

首先,我想我应该提到,我的所有服务器托管网站,并设置在staging.domain.com和domain.com(live)模式。

在每台服务器中,我有一个父级回购站,它是一个网站和一个子回购站,它是我的核心库。我需要我的核心在我的所有服务器上保持一致,但网站回购对于他们所在的服务器来说都是唯一的。我想将更改写入核心,同时推送到所有分段域,然后做一些质量保证,并推送到所有活动的服务器。

我原本以为子模块能够满足我的需求,但是我遇到的问题是我需要核心一次全部更新。如果我使用子模块,我的核心将更新,但不会影响,直到父网站运行git submodule update和git commit。

我想,为什么不使用gitignore来忽略核心所在的文件夹,并将它们当作独立实体来对待。有没有其他人做到这一点?我会遇到什么问题?您有什么更好的建议?



预先感谢您。 解决方案

除了子模块,您可以使用 git-subtree 使用范例


I want to nest 2 git repos. I have been reading into submodules and for a while i thought it was great, I think I may want something else. Here is my situation:

First I think I should mention that all of my servers host websites and are setup in a staging.domain.com and domain.com (live) pattern.

In each server I have a parent repo that is a website and a child repo which it my core library. I need my core to be the same on all of my servers but the website repos will all be unique to the server where they live. I want to write changes to the core, push to all staging domains simultaneously, then do some quality assurance, and push to all live servers.

I originally though that submodules would meet my needs but the issue I have with them is that I need the cores to update all at once. If I use submodules my core will update but won't take affect until the parent website runs git submodule update and git commit.

I figure why not just use a gitignore to ignore the folder that the core is in and treat them like they're separate entities. Has anyone else done this? What problems will I run into? Do you have any better suggestions?

Thank you in advance.

解决方案

Instead of submodules you can use git-subtree (Sample of usage)

这篇关于使用gitignore来嵌套存储库。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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