具体错误信息:
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password
根据报错提示2FA,猜测在启用双因素认证后,需要创建个人访问令牌作为新的身份验证方式,以解决HTTPBasic访问被拒绝的问题。
解决方式:
1. 登录GitLab,查看个人配置信息->Access Tokens,新增个人令牌,如下图:

将上图中的ToKen保存下来,即password
2. 新增勾选所有Scopes,在Shell窗口输入指令,例如git pull,将有窗口提示需要输入username、password,其中用户名可以通过以下命令查看:
git config user.name # 查看设置的用户名
密码使用上述步骤1中的ToKen,后续可正常使用。



10万+

被折叠的 条评论
为什么被折叠?



