简体   繁体   中英

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. /repositoryroot/myapp

When I normally push the app to heroku, I use 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.

The heroku docs say I can push a local branch to heroku master with 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.

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? Do I need a special refspec? Or is this even possible?

Thanks

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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