在heroku上部署git子目录 [英] Deploy git subdirectory on heroku

查看:109
本文介绍了在heroku上部署git子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从非主分支部署git子目录。我已经看过这个答案并且 Heroku上的文档,但是当我问题

  git subtree push --prefix visualizations heroku develop:master 

我得到以下错误:

 错误:src refspec d02911f4e410256fae0760f87f186289436ff98b: refs / heads / develop不匹配任何

我真的不知道如何继续。 git subtree push 命令不会使用<$ c $>命令。 c>在本地 git push 中使用的localBranch:remoteBranch 语法来定义本地分支被推入什么远程分支。你可能需要的只是改变最后一个参数:

$ g $ p $ g $ git subtree push --prefix visualizations heroku master

由于 git subtree push 会为子树创建一个新的提交,并且这是推送的,没有必要定义一个本地分支作为源。



使用上述命令,您告诉git从<$创建一个新的子树提交c $ c> visualizations 并将其推送到 heroku 远程的 master 分支。


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.

解决方案

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.

这篇关于在heroku上部署git子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆