将不同的分支推送到Heroku

tom*_*456 46 git heroku

刚刚在我的other分支上完成了工作.现在我需要在合并master分支之前测试它是否适用于Heroku .

是否有可能将other分支推送到Heroku并且它取代了我最后一次从master分支推送的内容?

amg*_*era 92

是的,推送到一个名称不同的分支,使用语法可以使用当前的分支:

git push heroku other:master
Run Code Online (Sandbox Code Playgroud)

这告诉Git将other分支的内容推送到远程master分支heroku.请记住,如果heroku/master您的other分支中没有出现提交,则可能必须强制推送.

欲了解更多信息,有一个看的的文件<refspec>选项git push.