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 致命的:我不知道';t句柄协议_Git_Heroku - Fatal编程技术网

Git 致命的:我不知道';t句柄协议

Git 致命的:我不知道';t句柄协议,git,heroku,Git,Heroku,当我尝试推送到Heroku时,我得到以下错误消息 [first_app]$git push heroku master fatal: I don't handle protocol 'git@heroku.com:yourhttp' 然后,我查看了我拥有的Heroku的不同版本,似乎不止一个版本,因此我尝试删除它,但收到另一条错误消息 [first_app]$ git remote set-url --delete heroku git@heroku.com:yourhttp://still-

当我尝试推送到Heroku时,我得到以下错误消息

[first_app]$git push heroku master
fatal: I don't handle protocol 'git@heroku.com:yourhttp'
然后,我查看了我拥有的Heroku的不同版本,似乎不止一个版本,因此我尝试删除它,但收到另一条错误消息

[first_app]$ git remote set-url --delete heroku git@heroku.com:yourhttp://still-lake-3136.herokuapp.com/.git
fatal: Will not delete all non-push URLs
我搜索了类似的错误消息,但找不到任何可以修复此错误的内容。非常感谢你的帮助

这是我的配置文件:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = git@github.com:wongsteven/first_app.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "heroku"]
    url = git@heroku.com:yourhttp://still-lake-3136.herokuapp.com/.git
    fetch = +refs/heads/*:refs/remotes/heroku/*
[heroku]
    remote = heroku
| | | |

Git使用不同的协议来“推送”代码,可以是https/ssh等

存储库的根目录中可能有.git/config文件

它具有源站的配置信息:

[remote "origin"]
#url = ssh://git@bitbucket.org/user/repo.git
url=git@heroku.com:myheroku.git
fetch = +refs/heads/*:refs/remotes/origin/*
如果您看到这个url信息git@something:repo.com

如果你在那里看url,你会发现它是这样的 git@heroku.com:yourhttp(url)这就是问题所在,您的应用程序url位于配置中


在heroku上的应用程序页面上,您可以找到git repo的uri,将url更改为该url,一切都会正常运行。

错误在您的配置中。这一行:

[remote "heroku"]
    url = git@heroku.com:yourhttp://still-lake-3136.herokuapp.com/.git
这完全是胡说八道。我不知道那句台词是怎么结束的。你一定是用错误的方法从某处复制粘贴了什么东西。我猜应该是这样的:

[remote "heroku"]
    url = git@heroku.com:still-lake-3136.git
如果这不起作用,您应该按照此处的说明启动远程存储库:

在这种情况下,您可以从
config
文件中删除整个
[远程“heroku”]
部分(实际上是最后5行),然后再继续执行这些说明


这两种方法中的一种(编辑行或重新初始化存储库)应该可以解决您的问题。

在Git存储库的url周围加引号(这对我来说很有效。我使用的是Windows 8.1)

有相同的问题,但其原因与此处提到的其他解决方案不同

我正在使用SourceTree,在添加远程url时,意外地添加了额外的前缀空间

我的配置(错误)

正确的

url = ssh://url.com/path/repo.git

我已经多次看到这个问题,而且总是在Windows计算机上。从剪贴板粘贴时,窗口会在粘贴内容的开头插入一个不可见的额外字符


解决方案是删除粘贴内容的第一个字符以及之前的字符,然后重新键入。

您的
.git/config
文件的内容是什么?在答案中贴出来。嘿,卡斯珀,一开始,我觉得找到文件“.git/config”非常困难。然后,我可以通过在终端中键入“subl.git/config”来打开.git/config文件。是否有其他方法检索此文件?谢谢嘿Casper我改了这行“url=git@heroku.com:yourhttp://still-lake-3136.herokuapp.com/.git“至”url=git@heroku.com:secret-brushlands-7492.git“它现在似乎有效。这个解决方案对我有效。我正在运行命令:$git remote add origin“”,然后我就可以运行命令:$git push--set upstream origin master
url = ssh://url.com/path/repo.git