之前本地一直用git clone去下载码云上面的代码。用的是A账号。
现在去新建B账号,然后去下载码云的代码,结果出错:
<code>➜ yyy git clone https://gitee.com/xxx Cloning into ‘xxx'... fatal: Authentication failed for 'https://gitee.com/xxx'; </code>
Cloning into fatal Authentication failed for
码云 Cloning into fatal Authentication failed for
去试试别人说的:
<code>git push https://[email protected]/jmpp/CommonEvent.git </code>
这种。
但是好像还是不行:
<code>➜ aaaaa git clone https://[email protected]/xxx_yyy/zzzz Cloning into 'zzzz'... Password for 'https://[email protected]': fatal: Authentication failed for 'https://[email protected]/xxx_yyy/zzzz/' </code>
ubuntu – git clone over https 401 error and not asking for username or password – Stack Overflow
试了:
<code>➜ aaaaa git clone xxx_yyy@https://gitee.com/xxx_yyy/zzzz Cloning into 'zzzz'... fatal: I don't handle protocol 'xxx_yyy@https' </code>
也不行。
后来发现上面用户名@时,是用户名写错了,xxx_yyy错写为xxx-yyy了。
用正确的用户名,就可以了:
<code>➜ aaaaa git clone https://[email protected]/xxx_yyy/zzzz Cloning into 'zzzz'... Password for 'https://[email protected]': remote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. </code>
【总结】
此处用git clone地址:
https://@gitee.com/xxx_yyy/zzzz
时由于用了旧的账号,没有弹出用户名和密码,所以出错。
而想要有机会用新账号,输入新账号密码,则可以用:
<code>git clone https://[email protected]/xxx_yyy/zzzz </code>
把YOUR_USERNAME换成你的用户名即可。
然后会提示你输入密码,即可正常下载代码。
转载请注明:在路上 » 【已解决】git clone出错:Cloning into fatal Authentication failed for