I've set up a Heroku app, lucy-staging
:
Kurts-MacBook-Pro-2:lucy kurtpeek$ git remote -v
staging https://git.heroku.com/lucy-staging.git (fetch)
staging https://git.heroku.com/lucy-staging.git (push)
I have a local branch, custom-error-views
, which I'd like to push to the master
branch of the staging
remote. I'm trying to follow https://devcenter.heroku.com/articles/multiple-environments#advanced-linking-local-branches-to-remote-apps by using the command git push staging custom-error-views:master
, adapted to push a Git subtree:
Kurts-MacBook-Pro-2:lucy kurtpeek$ git subtree push staging custom-error-views:master --prefix lucy-web/
'custom-error-views:master' does not look like a ref
I don't understand this does not look like a ref
error; it seems analogous to the development:master
ref in the Heroku documentation. Can anyone point out what is wrong here?
Update
It would appear from the source code (https://github.com/github/git-msysgit/blob/master/contrib/subtree/git-subtree.sh) that this error message is thrown specifically for git subtree
s. It reduces to the fact that git check-ref-format
returns a non-zero error code:
Kurts-MacBook-Pro-2:lucy kurtpeek$ git check-ref-format custom-error-views:master
Kurts-MacBook-Pro-2:lucy kurtpeek$ echo $?
1
I managed to push the subtree to the master branch of the remote using the following command:
git push staging `git subtree split --prefix lucy-web staging`:master
This can be summarized as the following:
git push [REMOTE_NAME] `git subtree split --prefix [SUBDIR_PATH] [BRANCH]`:master
Using this summary, the example above has the following structure:
This is similar to one of the answers given at How can I push a part of my git repo to Heroku?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With