git clone 命令不起作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41199531/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:41:40  来源:igfitidea点击:

git clone command is not working?

gitgithubbitbucket

提问by vimal mishra

I am trying to clone bit bucket repo. Once I execute the following command after installing git I am facing following issue :

我正在尝试克隆位存储桶回购。在安装 git 后执行以下命令后,我面临以下问题:

$ git clone https://[email protected]/username/reponame.git
Error :fatal: unable to access'https://[email protected]/username/reponame.git/': 
Failed to connect to hostname port 8000: Connection refused

How can I get past this error message?

我怎样才能克服这个错误信息?

采纳答案by VonC

An https url should attempt to contact the port 443.

https url 应尝试联系端口 443。

If it tries to contact 8000, that might indicate an intermediate proxy: check git config -l|grep -i proxy, or your environment variable (env or set|grep -i proxy)

如果它尝试联系 8000,则可能表示中间代理: checkgit config -l|grep -i proxy或您的环境变量 ( env or set|grep -i proxy)

You can also try a curl -L -v https://[email protected]/username/reponame.gitto have more information.

您也可以尝试curl -L -v https://[email protected]/username/reponame.git获取更多信息。

Finally, don't forget to try and clone through ssh if https does not want to work: see "Set up SSH for Git", and git clone [email protected]:user/repo.git.

最后,如果 https 不想工作,请不要忘记尝试通过 ssh 进行克隆:请参阅“为 Git 设置 SSH”和git clone [email protected]:user/repo.git.

回答by gopuvp

Modify your url to use git or ssh protocol for transfer.

修改您的 url 以使用 git 或 ssh 协议进行传输。

e.g. git clone https://github.com/abcd/bashScripts.git

例如 git clone https://github.com/abcd/bashScripts.git

becomes:

变成:

git clone [email protected]:abcd/bashScripts.git

git 克隆 [email protected]:abcd/bashScripts.git