与Heroku的Git子模块 [英] Git Submodules with Heroku

查看:112
本文介绍了与Heroku的Git子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



在Heroku上有一个Rails 3.1应用程序,它很快将需要一些(第三方)子模块(其中一些子模块)。不幸的是,Heroku缺乏子模块支持。 Heroku网站上的一个建议是将子模块的内容移动到主库(此处 )。这将在第一时间正常工作,但有可能不会第二次。这可能是
所造成的,因为快速转发合并不成功的第三方子模块中的主要更新。很明显,我们不能手动合并第三方项目。



解决方案



我们暂时的解决方案是如下所示:


  1. 根据最新的稳定开发分支创建一个新的'temp'分支,并将子模块合并到项目中。

    li>
  2. 签出一个'heroku'分支。

  3. 删除这个heroku分支的内容以避免任何可能的冲突,例如创建一个删除所有内容的提交。 / li>
  4. 将temp分支合并到heroku分支中。

  5. 将这个heroku分支推送到我们的heroku服务器。 >

    优点



    这样可以避免第三方子模块发生任何可能的冲突,并且可以编写脚本。



    缺点



    这非常不雅观,是SVC的最终反模式。

    问题



    有没有更好的方法来做到这一点?


    <解决方案Heroku现在支持子模块。



    http://devcenter.heroku.com/articles/git-submodules



    但是,此功能不支持子模块这是私人的。


    The Problem

    I have a Rails 3.1 app on Heroku which will soon require a bunch of (3rd party) submodules (some of which have submodules). Unfortunately, Heroku lacks submodule support. One suggestion on Heroku's website is to move the contents of the submodules into the main repo (here). This will work fine the first time, but there is a possibility that it wont the second. This could be caused by a major update in one of the third party submodules where a fast forward merge is unsuccessful. Obviously we can't manually merge a third party project.

    The "Solution"

    Our tentative solution is as follows:

    1. Create a new 'temp' branch based off of the latest stable dev branch and merge the submodules into the project.
    2. Checkout to a 'heroku' branch.
    3. Nuke the contents of this heroku branch to avoid any possible conflicts, i.e. create a commit with everything deleted.
    4. Merge the temp branch into the heroku branch.
    5. Push this heroku branch to our heroku server.

    The Advantages

    This will avoid any possible conflicts in third party submodules and is scriptable.

    The Disavantages

    This is extremely inelegant and is the ultimate anti-pattern for SVC.

    The Question

    Is there a better way to do this?

    解决方案

    Heroku now supports submodules.

    http://devcenter.heroku.com/articles/git-submodules

    However, this feature does not support submodules that are private.

    这篇关于与Heroku的Git子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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