有时候确实是密码输入错误,登陆gitlab重置下密码。

gitlab的https用户定义密码认证方式被关闭了,那就改成ssh方式
在项目根目录:

git remote set-url origin git@git.example.com:test.git 

将项目从https源换成ssh

本机生成SSH Key

ssh-keygen -t rsa -C "your_email@example.com" 

cat ~/.ssh/id_rsa.pub
将ssh-key放到gitlab -- settings -- SSH Keys

Username for 'https://git.example.com': zhang
Password for 'https://zhang@git.example.com': 
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://git.example.com/profile/personal_access_tokens
fatal: Authentication failed for 'https://git.example.com/zhang/test.git/'

 

其它:
账号密码改过:
git config –system –unset credential.helper 重新输入新账号密码
如不能解决:
git config –global http.emptyAuth true

相关文章:

  • 2022-01-02
  • 2021-05-17
  • 2022-12-23
  • 2021-07-22
  • 2022-01-21
  • 2022-01-13
  • 2021-08-18
猜你喜欢
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案