在密码中用斜杠克隆回购 [英] Clone a repo with Slash in Password
问题描述
git克隆https://用户名:password@github.com/username/完成repository.git
但是,当密码包含正斜杠时,这不起作用。错误是:
错误:无法在访问
时解析主机'klaus777:password'https:// klaus777 :password /.@bitbucket.org/romeo/server-code.git/info/refs
致命错误:HTTP请求失败
如果我的URL编码斜杠,我得到以下错误:
错误:请求的URL在访问
时返回错误:401 https:// klaus777:password%2F%2E@bitbucket.org/romeo/server-code.git/info/refs
致命:HTTP请求失败
因此,问题:你如何处理密码中的正斜杠?
PS。如果我从网址中删除密码并在出现提示时提供密码,那么一切正常。
正确斜杠的百分比编码应单独为%2F
,勾选如果您需要编码您似乎的<%2E
) https:// klaus777:密码%2F。@ bitbucket.org / romeo / server-code .git
我更改了密码。
Cloning a repo can be done with
git clone https://username:password@github.com/username/repository.git
However, when the password contains a forward slash, this doesn't work. Error is:
error: Couldn't resolve host 'klaus777:password' while accessing
https://klaus777:password/.@bitbucket.org/romeo/server-code.git/info/refs
fatal: HTTP request failed
If I URL Encode the Slash, I get the following error:
error: The requested URL returned error: 401 while accessing
https://klaus777:password%2F%2E@bitbucket.org/romeo/server-code.git/info/refs
fatal: HTTP request failed
Hence, the question: How do you deal with forward slash in password?
PS. If I remove password from URL and provide it when prompted, everything works just fine.
A percent encoding for forward slash should be %2F
alone, check if you need to encode the '.
' (%2E
) that you seem to also have in your password.
https://klaus777:password%2F.@bitbucket.org/romeo/server-code.git
That doesn't seem to work for GitHub though: the OP Klaus confirms in the comments:
I changed the password.
这篇关于在密码中用斜杠克隆回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!