Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git &引用;吉特<;参考规范>;看起来不像ref;正在尝试将本地分支链接到远程Heroku应用程序_Git_Heroku - Fatal编程技术网

Git &引用;吉特<;参考规范>;看起来不像ref;正在尝试将本地分支链接到远程Heroku应用程序

Git &引用;吉特<;参考规范>;看起来不像ref;正在尝试将本地分支链接到远程Heroku应用程序,git,heroku,Git,Heroku,我已经安装了一个Heroku应用程序,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) 我有一个本地分支,自定义错误视图,我想将其推送到暂存远程的主分支。我试图通过使用命令git push stagi

我已经安装了一个Heroku应用程序,
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)
我有一个本地分支,
自定义错误视图
,我想将其推送到
暂存
远程的
分支。我试图通过使用命令
git push staging custom error views:master
(适用于推送git子树):

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
我不明白这个
看起来不像ref
错误;它似乎类似于Heroku文档中的
development:master
ref。有人能指出这里出了什么问题吗

更新

从源代码()可以看出,此错误消息是专门为
git子树抛出的。它简化为返回一个非零错误代码:

Kurts-MacBook-Pro-2:lucy kurtpeek$ git check-ref-format custom-error-views:master
Kurts-MacBook-Pro-2:lucy kurtpeek$ echo $?
1

我使用以下命令将子树推送到远程服务器的主分支:

git push staging `git subtree split --prefix lucy-web staging`:master
这可以概括如下:

git push [REMOTE_NAME] `git subtree split --prefix [SUBDIR_PATH] [BRANCH]`:master
使用此摘要,上面的示例具有以下结构:

  • 远程名称-暂存
  • 子目录路径-lucy web
  • 分支机构-暂存

这类似于

中给出的一个答案,我没有对任何真实的东西使用
git子树
,但它看起来像是
git子树推送
从运行
git子树拆分
开始,生成新的提交链并生成其哈希ID。
git子树推送
然后将该哈希ID推送到远程引用:
git推送:
。因此,通过refspec提供本地引用对您来说毫无意义:如果您在遥控器上按下一个分支名称,并且您具有相应的
fetch
远程设置,您将获得与遥控器的分支名称相对应的远程跟踪名称。您好,这似乎无法解决问题,如何使用此语法选择要推送的分支?我想推动分支机构“发展”而不是“掌握”?