git 无法从 bitbucket 拉取或推送代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17540391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't pull or push code from bitbucket
提问by Artis
the thing is, suddenly git stoped working.. I can't push or pull code from bitbucket, I cant clone the repos either..
问题是,突然 git 停止工作了..我无法从 bitbucket 推送或拉取代码,我也无法克隆存储库..
$ git pull origin master
error: Failed connect to bitbucket.org:443; Operation now in progress while accessing https://[email protected]/username/username.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
$ git push origin master
error: Failed connect to bitbucket.org:443; Operation now in progress while accessing https://[email protected]/username/username.git/info/refs?service=git-receive-pack
fatal: HTTP request failed
I can however clone the repos from github
但是,我可以从 github 克隆 repos
$ git clone https://github.com/rails/rails.git
Cloning into 'rails'...
remote: Counting objects: 374775, done.
remote: Compressing objects: 100% (100606/100606), done.
remote: Total 374775 (delta 288080), reused 356367 (delta 270840)
Receiving objects: 100% (374775/374775), 56.24 MiB | 4.47 MiB/s, done.
Resolving deltas: 100% (288080/288080), done.
iptables
iptables
$ sudo iptables -L -n
[sudo] password for user:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
also I have run sudo ufw disable...
我也运行了 sudo ufw disable ...
Any help is much appreciated!
任何帮助深表感谢!
回答by VonC
This could be a side-effect of the recent incident seen in the BitBucket status history:
这可能是BitBucket 状态历史记录中最近发生的事件的副作用:
22:52 UTC We're investigating an issue with the site affecting all users. We'll keep you posted as we know more.
23:23 UTC The problem appears to be a networking issue and we're working to resolve it as soon as possible.
22:52 UTC 我们正在调查影响所有用户的网站问题。当我们了解更多信息时,我们会及时通知您。
UTC 时间 23:23 问题似乎是网络问题,我们正在努力尽快解决。
That, or your proxy has changed its policies, and now block bitbucket, but not github (but I doubt that.)
This error message has been seen when no proxy is defined.
那,或者你的代理已经改变了它的策略,现在阻止了 bitbucket,但不是 github(但我怀疑这一点。)当没有定义代理时已经看到
这个错误消息。
If you have registered a public ssh key, you can try if the ssh url work better.
如果您已经注册了公共 ssh 密钥,您可以尝试 ssh url 是否工作得更好。
ssh://[email protected]:username/repo.git
回答by Rohan Khude
I got same issue.
我有同样的问题。
I tried to update git by ppa, Reset .gitconfig,i checked github repo is getting clone but not bitbucket, i unset http and https proxy, restarted my network services(type in terminal - 'my network services'), changed the network that my laptop was connected. But none of this didn't work for me.
我尝试通过 ppa 更新 git,重置 .gitconfig,我检查了 github repo 正在获取克隆但不是 bitbucket,我取消了 http 和 https 代理,重新启动了我的网络服务(输入终端 - “我的网络服务”),改变了网络我的笔记本电脑已连接。但这些都对我不起作用。
i got fixed by adding below line to hosts(/etc/hosts) file
我通过在主机(/etc/hosts)文件中添加以下行来修复
104.192.143.2 bitbucket.org
104.192.143.2 bitbucket.org
Another solutions i didn't tried are
我没有尝试过的另一个解决方案是
using proxy for cloning git, Connecting to Bitbucket using ssh through proxy
使用代理克隆 git,通过代理使用 ssh 连接到 Bitbucket