致命:我不处理协议



当我尝试推送到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

无法推至heroku|git错误:无法处理https|heroku+git子模块需要身份验证|错误:";致命的:我不;使用捆绑包安装时处理协议`git`|Git/GitHub可以';t推送到主

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

错误在您的配置中。此行:

[remote "heroku"]
    url = git@heroku.com:yourhttp://still-lake-3136.herokuapp.com/.git

完全是胡说八道。我不知道那条线是怎么结束的。你一定是用错误的方式从某个地方复制粘贴了什么东西。我猜它应该是这样的:

[remote "heroku"]
    url = git@heroku.com:still-lake-3136.git

如果这不起作用,你应该按照这里的说明启动远程存储库:

https://devcenter.heroku.com/articles/git

在这种情况下,您可以在继续执行这些指令之前,从config文件中删除整个[remote "heroku"]部分(实际上是最后5行)。

其中之一(编辑行或重新初始化存储库)应该可以解决您的问题。

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/*

如果你看到这个网址信息git@something:repo.com

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

在heroku上的应用程序页面上,你会发现git-reo的uri。将url更改为该url,事情应该会运行良好。

有同样的问题,但原因与这里提到的其他解决方案不同。

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

我的配置(错误)

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

纠正

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

我在Windows计算机上看到过很多次这个问题。从剪贴板粘贴时,Windows会在粘贴内容的开头插入一个不可见的额外字符。

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

最新更新