git push错误"fatal: Unable to find remote helper for 'https'"

9
我已添加了远程源,如下所示:

git remote add origin https://github.com/username/repo.git

当我推送 Git 存储库时,会出现以下错误:
git push -u origin master
fatal: Unable to find remote helper for 'https'

我使用的是Ubuntu 10.04.4 LTS系统上的git 1.7.1版本。

如果您有任何想法,将不胜感激。

5个回答

10
如果你从源代码编译git,请确保先安装这个软件包: apt-get install libcurl4-openssl-dev

4
昨天我遇到了这个问题,今天解决了,所以在这里发布一下,以便帮助Windows用户。对我来说,问题出现在我更新到最新版本的Git之后(因为Visual Studio建议我这样做——有关匹配问题的事情)。结果发现我安装在默认目录Program Files中,但我的旧版本Git在Program Files (x86)中(尝试重新安装时才注意到)。卸载新版本并安装Other Git for Windows下载列表中列出的64位Git for Windows Setup(不是默认的)覆盖Program Files (x86)中的版本即可解决问题。(我先尝试了其他版本和文件夹的组合。)
在执行git push origin master之前,我必须删除已创建的本地存储库并重新开始git init、git add .、git commit -m "first commit"、git remote add origin theGitUrl(这些都曾经有效),然后弹出一个窗口要求输入用户名和密码。一开始我没注意到,还以为git push处理卡住了。所以,请注意使用“其他Git for Windows”版本。
在修复之前,我确实更改了环境变量;我不知道那是否有帮助。我将以下两个路径添加到PATH中: C:\Program Files (x86)\Git\bin C:\Program Files (x86)\Git\libexec\git-core 我在用户和系统变量中都这样做了。
关于在Windows 10中更新PATH的说明:您必须逐个添加,不要包括分号。

只需将路径添加到环境变量中,并修改Android Studio设置以使用来自git安装路径的git.exe即可解决我的问题! - Thiru

1

我在chroot监狱中工作,以为已经复制了所有需要使git工作的内容,但实际上缺少了git-core文件本身,所以我只需要把它们复制过来:

cp -r /usr/lib/git-core /opt/chroot/myjail/usr/lib/

1

恭喜修复成功!当您有时间时,请确保将您的答案标记为“已接受”,以便其他人能够从您的成功中学习。干杯~ - Andrew Kozak
问题可能存在于 Git 版本 >= 1.7.7。 - Thomas Hunter II

-3
Add this to git config: (Checked in centos 6.7 and working)
    #git config --global url.https://.insteadOf git://

#To see the config added
    #git config --list
    url.https://.insteadof=git://
    user.name=username
    user.email=youremail
    ....

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接