gitlab HTTP Basic: Access denied问题解决方法

Posted 船长博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gitlab HTTP Basic: Access denied问题解决方法相关的知识,希望对你有一定的参考价值。

有时候确实是密码输入错误,登陆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

以上是关于gitlab HTTP Basic: Access denied问题解决方法的主要内容,如果未能解决你的问题,请参考以下文章

remote: HTTP Basic: Access denied fatal: Authentication failed for

remote: HTTP Basic: Access denied fatal: Authentication failed

remote: HTTP Basic: Access denied fatal: Authentication failed

git remote: HTTP Basic: Access denied 错误解决办法

git中出现remote: HTTP Basic: Access denied

git push 报 HTTP Basic: Access denied 错误