我在代理下,我在相当长的一段时间内成功地推进。 现在我突然不能进入git了。 我已经设置了RSA密钥和代理,并仔细检查了它们,没有效果,git抛出了页面标题中显示的错误。
当前回答
问题
产生问题的步骤:git克隆git@github.com:sramachand71/test.git 这是新笔记本电脑里的第一次
错误
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方案
第一次在系统中克隆时,我们需要给clone命令加双引号。
$ git clone "git@github.com:sramachand71/test.git"
我在系统中遇到这个问题,即使一切都是正确的,但最后注意到双引号是url“repository_url”必须的。第一次或新用户在系统中。
其他回答
当我不小心切换到客户wifi网络时,我得到了这个错误。不得不切换回默认的wifi网络。
好试试这个ssh -T -p 443 git@ssh.github.com而不是ssh -T git@github.com
我也遇到了同样的问题,但找不到有效的解决方案。我在设置本地服务器时遇到了这个问题,git无法通过我的代理网络连接,但我的工作站可以。这是我运行命令时的输出 ssh -vT git@github.com
ubuntu@server:~$ ssh -vT git@github.com
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /home/ubuntu/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [13.234.176.102] port 22.
因此,我尝试通过编辑配置文件~/使用通过HTTPS端口建立的SSH连接。Ssh /config但是没有效果。
Host github.com
Hostname ssh.github.com
Port 443
最后,我找到了这篇文章,解决并暴露了真正的问题。
# github.com
Host github.com
Hostname ssh.github.com
ProxyCommand nc -X connect -x <PROXY-HOST>:<PORT> %h %p
Port 443
ServerAliveInterval 20
User git
这是我的配置文件,现在git通过ssh工作得很好!
问题
产生问题的步骤:git克隆git@github.com:sramachand71/test.git 这是新笔记本电脑里的第一次
错误
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方案
第一次在系统中克隆时,我们需要给clone命令加双引号。
$ git clone "git@github.com:sramachand71/test.git"
我在系统中遇到这个问题,即使一切都是正确的,但最后注意到双引号是url“repository_url”必须的。第一次或新用户在系统中。
上面的答案为我提供了解决这个问题所需的信息。在我的例子中,url错误地以ssh:///开头
要检查git配置中的url是否正确,请打开git配置文件:-
git config --local -e
检查url条目。它在开始时不应该有ssh:///。
不正确的条目:
url = ssh:///git@github.com:username/repo.git
正确的条目:
url = git@github.com:username/repo.git
如果您的url是正确的,那么下一步将是尝试上面建议将协议更改为http的答案。
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- git pull -rebase和git pull -ff-only之间的区别