简体   繁体   English

如何将子树从本地分支推送到heroku master

[英]How to git push subtree from a local branch to heroku master

I have a rails app that is not at the root of my git repository. 我有一个不在我的git存储库根目录的rails应用程序。 /repositoryroot/myapp / repositoryroot / MYAPP

When I normally push the app to heroku, I use git subtree -P myapp/ push heroku master . 当我通常将应用程序推送到heroku时,我使用git subtree -P myapp/ push heroku master

Now I've added a staging app on heroku and I have some changes under a local branch that I want to push to the staging app. 现在我在heroku上添加了一个临时应用程序,我在本地分支下进行了一些更改,我想将其推送到临时应用程序。

The heroku docs say I can push a local branch to heroku master with git push staging localbranch:master heroku文档说我可以通过git push staging localbranch:master将本地分支git push staging localbranch:master

But when I try to combine the two and do git subtree -P myapp/ push staging localbranch:master I get an error from git. 但是当我尝试将两者结合起来并执行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'

How do I push the subfolder that is the root of my app /repositoryroot/myapp from my local branch to heroku staging? 如何将作为app / repositoryroot / myapp根目录的子文件夹从本地分支推送到heroku staging? Do I need a special refspec? 我需要特殊的refspec吗? Or is this even possible? 或者这甚至可能吗?

Thanks 谢谢

我能够回答我自己的问题。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM