2016-11-21 116 views
1

我有一个不在我的git存储库根目录的rails应用程序。 /repositoryroot/myapp如何将子树从本地分支推送到heroku master

当我通常将应用推送到heroku时,我使用git subtree -P myapp/ push heroku master

现在我已经在heroku上添加了一个临时应用程序,并且我想在推送到临时应用程序的本地分支下进行一些更改。

Heroku的文档说我可以把本地分支Heroku的主用git push staging localbranch:master

但是当我尝试将二者结合起来,做git subtree -P myapp/ push staging localbranch:master我从git的错误。

error: src refspec d24e1<some more hex gibberish>202a54e:refs/heads/localbranch does not match any. 

error: failed to push some refs to 'https://git.heroku.com/mystagingapp.git' 

如何将我的app/repositoryroot/myapp根目录的子文件夹从本地分支推送到heroku分段? 我需要特殊的refspec吗?或者这甚至有可能?

谢谢

+0

我能回答我自己的问题。 'git push staging \'git subtree split -P myapp/localbranch \':refs/heads/master' – user1985503

+0

因为您的问题是由您自己解决的,您可以将您的方法作为答案并标记出来。 –

回答

0

我能回答我自己的问题。

git push staging `git subtree split -P myapp/ localbranch\`:refs/heads/master 
相关问题