Make Heroku run non-master Git branch

懵懂的女人 提交于 2019-12-29 10:04:05

问题


I have a project hosted on Heroku and it's gotten to the point where I want to make an alternate test server (so I can test Heroku workers without messing up production).

I have already set up my main Heroku remote running my trunk and a Heroku-dev remote on which I wish to run an alternate branch.

My problem is that since my alternate branch isn't master, Heroku won't build it.

$ git push heroku-dev test
counting objects ...
...
Pushed to non-master branch, skipping build.
To git@heroku.com:example-dev.git
* [new branch]      test -> test

Switching this build to master is not an option at the moment. Obviously one option is to create a whole new git repo that's a clone of my test branch, but that doesn't sound very ideal.


回答1:


You can push an alternative branch to Heroku using Git.

git push heroku-dev test:master

This pushes your local test branch to the remote's master branch (on Heroku).




回答2:


You will need to pull the remote branch first before you can push the non master branch.

Run following command in you local repository

git pull https://heroku:YOUR_HEROKU_API_KEY@git.heroku.com/YOUR_APP_NAME.git



回答3:


In case git push heroku-dev test:master doesn't work for you, try git push heroku test:master. Remember the "test" in "test:master" is the name of the new branch you are on.




回答4:


In my case, the default or base branch was develop, so i used:

          git push heroku develop:master 


来源:https://stackoverflow.com/questions/14593538/make-heroku-run-non-master-git-branch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!