git - 如何更改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-xyz
为varun9777
请帮忙。提前致谢。
解决方案
git remote set-url origin https://varun9797:yourPassword@github.com/varun9797/BetterWorldUI.git
我们可以设置包含 git 凭据的存储库 url。
推荐阅读
- graphql - 无法返回 null 或不可为 null 的字段 User.Role 无法从 prisma 突变中检索关系数据
- python - Matplotlib 使用滑块滚动图表时更新图表的更有效方式?
- javascript - 如何在其中插入一个javascript变量
- java - 使用 Scanner 类为构造函数变量获取用户输入
- php - 按一个数组的值对具有相同键的 2 个子数组进行排序
- swashbuckle - 如何删除此工件
- python-3.x - Python - 如何使用多变量重新输入异常?
- ios - 在 Swift 4 中将 UNNotificationAction 添加到 Firebase FCM 推送通知
- html - Laravel:添加数据后如何使用 Laravel 打印票?
- powershell - Invoke-WebRequest:底层连接已关闭:通过代理发送时发生意外错误