Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy git subdirectory on heroku

I have to deploy a git subdirectory from a non master branch. I have looked at this answer and to the docs on Heroku, but when I issue

git subtree push --prefix visualizations heroku develop:master

I get the following error

error: src refspec d02911f4e410256fae0760f87f186289436ff98b:refs/heads/develop does not match any

And I really don't know how to proceed.

like image 526
gcedo Avatar asked Sep 18 '13 09:09

gcedo


People also ask

How do I push a git repo to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.

Can I git pull from Heroku?

Also note that Heroku should not be considered a git hosting. It means that it's extremely uncommon to perform a git pull from Heroku. Instead, you should use a git hosting (such as GitHub or BitBucket) to store your repository and only perform push to Heroku to deploy the application.

Can I deploy private GitHub repo to Heroku?

Heroku Button is no longer limited to source code hosted in public GitHub repos. It now works with both public and private GitHub repos.

Is Heroku integrated with Git?

Heroku integrates with GitHub to make it easy to deploy code living on GitHub to apps running on Heroku. When GitHub integration is configured for a Heroku app, Heroku can automatically build and release (if the build is successful) pushes to the specified GitHub repo.


1 Answers

The git subtree push command does not use the localBranch:remoteBranch syntax used in the plain git push to define what local branch gets pushed into what remote branch. What you might need is just to change that last parameter:

git subtree push --prefix visualizations heroku master

Since git subtree push creates a new commit for the subtree, and that is the one pushed, there is no need define a local branch as a source.

With the above command you are telling git to create a new subtree commit from visualizations and to push it to the master branch on the heroku remote.

like image 77
Maic López Sáenz Avatar answered Sep 17 '22 18:09

Maic López Sáenz