如何修复“fatal: unable to look up https (port 9418) (No such host is known)”错误?

3
我正在尝试使用Git push命令进行推送:
git push -u origin --all

这是我的问题:

Fatal: unable to look up https (port 9418) (No such host is known. )

我运行了ping github.com并获取到了IP,但我不知道该怎么处理。


git remote -v ? - phd
1
抱歉我的错误,我已经修复了。当我使用 git remote -v 命令时,它显示如下:origin git://https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git (fetch) origin git://https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git (push)你有什么建议吗? - Anh Bui
2个回答

5
您的远程 URL 不正确 - git:// 是 Git 协议的名称(端口 9418),不需要跟随其他协议名称。
请尝试以下操作:
git remote set-url origin https://anhbui2904@bitbucket.org/anhbui2904/sample_app.git

这将把你的origin远程URL设置为使用HTTPS。

0
如果git remote set-url origin无法工作,您可以直接编辑

.git/config

文件,并将git://https://前缀修复为所需的git://https://

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