首页 > 解决方案 > 如何更改git中的用户名?

问题描述

我知道这是一个常见问题,但即使应用了各种解决方案,我仍然无法更改用户名。每次当我尝试在 git 上推送我的更改时,我都会遇到错误。

PS C:\storage\class\11-1\Angular> git push origin DevBW-AngularAws remote: Permission to varun9797/BetterWorldUI.git denied to test9777. fatal: unable to access 'https://github.com/varun9777/BetterWorldUI.git/': The requested URL returned error: 403

我也尝试了以下命令。

git config credential.username "varun9777"

但仅在推送时仍会出现相同的错误。

我想将用户名更改abc-xyzvarun9777

请帮忙。提前致谢。

标签: gitgithubsshgitlab

解决方案


git remote set-url origin https://varun9797:yourPassword@github.com/varun9797/BetterWorldUI.git

我们可以设置包含 git 凭据的存储库 url。


推荐阅读