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子树推送错误_Git_Heroku - Fatal编程技术网

&引用;“不合格目的地”;git子树推送错误

&引用;“不合格目的地”;git子树推送错误,git,heroku,Git,Heroku,我刚刚创建了一个新的Heroku应用程序,但我没有将我的回购(分支暂存)的子树文件夹后端)推送到新创建的应用程序myapp暂存(还没有分支) 下面是我推送子树的方式: git push heroku `git subtree split --prefix=backend staging`:master 出现相关错误的原因如下: error: unable to push to unqualified destination: master The destination refspec nei

我刚刚创建了一个新的Heroku应用程序,但我没有将我的回购(分支
暂存
)的子树文件夹
后端
)推送到新创建的应用程序
myapp暂存
(还没有分支)

下面是我推送子树的方式:

git push heroku `git subtree split --prefix=backend staging`:master
出现相关错误的原因如下:

error: unable to push to unqualified destination: master
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@heroku.com:myapp-staging.git'

我尝试了
git获取heroku
。“不合格目的地”是什么意思?这个命令不应该创建远程分支吗?

好的,多亏了

我试过:

git subtree split --prefix=bakcend -b test
git push heroku test:master
它就像一个符咒。可能问题在于使用subtree命令创建分支…

如前所述,您可以点击
refs/heads/master
来解决此问题,然后您可以切换回
master
,尽管我仍然不完全确定/为什么/这样做有效

# run this once
git push origin master:refs/heads/master

# now you can use this forever
git push origin master

您的解决方案可行,但我想知道为什么第一种方法不起作用。因为在很多地方,这被认为是正确的做法。