English 中文(简体)
吉苏·苏阿库特
原标题:Git Submodules with Heroku

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 won t 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"

我们的暂定解决办法如下:

  1. Create a new temp branch based on 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

这将避免第三方分流中可能出现的任何冲突,并且可以描述。

The Disadvantages

这种做法极为不利,是特别志愿人员的最高抵抗者。

The Question

是否有更好的办法这样做?

最佳回答

Heroku现在支持分流。

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

然而,这一特点并不支持私人的子宫。

问题回答

另一种替代办法是:

Go to /a>,并可以<代码>repo<>/code>范围为凭。

现在可以做git lin https://

Since Heroku doesn t currently support submodules, one other possible way would be to use sub-tree merging.

基本上来说,子树mer合并是一种吉祥的合并战略,使你能够把另一个宝库合并到你身上,但放在你选择的子里。 有一个名为“git-subberry/code>,该工具试图以类似于git-submodule(1)的方式对这一过程进行总结。

git-joint(1) man page外,还有其他一些条款可帮助您执行这一合并战略:

你可以简单地增加公共支部,她的oku将在你部署时为你们 for。

Heroku 解释了

$ git submodule add https://username:[email protected]/myusername/FooBar

不幸的是,当你这样做时,就把你的用户名和密码放在简单文本中。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...