git clone 踩坑

3,146 阅读1分钟

git clone https://gitlab.com/groupName/projectName.git,

在clone过程中提示需要输入username、password

error:

remote: HTTP Basic: Access denied

fatal: Authentication failed for 'https://gitlab.com/groupName/projectName.git/'

解决方案:

首先检查你的账号是否有该项目的权限,其次检查自己输入的username、password是否正确;

如果不记得自己的username和password,就去gitlab上去重新设置

git config --global user.name xxxx 设置你的用户名

git config --list  查看设置的值

再次 git clone

remote: HTTP Basic: Access denied

remote: You must use a personal access token with 'read_repository' or 'write_repository' scope for Git over HTTP.

remote: You can generate one at https://gitlab.com/profile/personal_access_tokens

fatal: Authentication failed for 'https://gitlab.com/groupName/projectName.git/'

访问https://gitlab.com/profile/personal_access_tokens,去设置一个access_token,

设置成功之后,然后再次 git clone,然后把password替换成

Your New Personal Access Token  的access_token值