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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM