英文:
How to fix GitHub profile conflicts?
问题
终端上的全局配置文件为0xminer11,并且在提交代码时也使用了相同的配置文件,我希望在推送代码时仍然使用相同的配置文件,但在推送时出现了不同的配置文件。
你可以查看我的日志。
naveenarali@NaveenAralis-MacBook-Air gasless-Txs. % git config --global user.name 
0xminer11
naveenarali@NaveenAralis-MacBook-Air gasless-Txs. % git push origin dev
remote: Permission to 0xminer11/gasless-Txs..git denied to cclchd-naveenkumar.
fatal: unable to access 'https://github.com/0xminer11/gasless-Txs..git/': The requested URL returned error: 403
所以是否有解决这些冲突的解决方案或建议?
我已在全局配置了GitHub账户的用户名和电子邮件,但仍然面临相同的问题。
英文:
The global profile on my terminal was 0xminer11 and its committed using the same profile and I want to use the same profile to push the code as well. but while pushing, it was taking on a different profile.
you can see my logs.
naveenarali@NaveenAralis-MacBook-Air gasless-Txs. % git config --global user.name 
0xminer11
naveenarali@NaveenAralis-MacBook-Air gasless-Txs. % git push origin dev
remote: Permission to 0xminer11/gasless-Txs..git denied to cclchd-naveenkumar.
fatal: unable to access 'https://github.com/0xminer11/gasless-Txs..git/': The requested URL returned error: 403
So is there any solution or suggestions to maintain these conflicts?.
I globally configured my GitHub account username and email. but still am facing the same issue.
答案1
得分: 1
Double-check your git credential helper, which might have cached the wrong credentials for github.com accessed with HTTPS.
printf "host=github.com\nprotocol=https" | git credential-xxx get
(Replace xxx with the value of git config --global credential.helper)
If you have multiple accounts accessing GitHub, it is better to include the GitHub user account name (which, as commented, has nothing to do with git config user.name) in the remote URL
cd /path/to/local/repository
git remote set-url origin https://0xminer11@github.com/0xminer11/myRepo
                                  ^^^^^^^^^^
Then a git push should trigger a popup asking for your GitHub 0xminer11 account token (not password)
英文:
Double-check your git credential helper, which might have cached the wrong credentials for github.com accessed with HTTPS.
printf "host=github.com\nprotocol=https" | git credential-xxx get
(Replace xxx with the value of git config --global credential.helper)
If you have multiple accounts accessing GitHub, it is better to include the GitHub user account name (which, as commented, as nothing to do with git config user.name) in the remote URL
cd /path/to/local/repository
git remote set-url origin https://0xminer11@github.com/0xminer11/myRepo
                                  ^^^^^^^^^^
Then a git push should trigger a popup asking for your GitHub 0xminer11 account token (not password)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论