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

GitLab SSH密钥配置指南
本文详细介绍了当GitLab的HTTPS密码认证被关闭时,如何通过生成SSH Key并将其添加到GitLab账户中,实现从HTTPS切换到SSH的方式进行项目操作。包括SSH Key的生成、添加以及远程仓库地址的修改等关键步骤。

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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值