git - 两个github账号在同一台电脑上冲突
问题描述
我有 2 个 github 帐户,一个用于个人使用,一个用于工作。
我在一个个人网站上工作,所以我使用我的个人用户名和密码从终端登录了 git。当我执行“git config --list”时,我会看到我个人帐户的正确用户名和密码,正如我所期望的那样。
但是,当我尝试将我的代码推送到我的个人帐户时,它会出现此错误...
remote: Permission to <personal_username>/<personal_repo>.git denied to <work_username>.
我什至不知道它从哪里获取我的工作用户名或工作凭据,因为它们没有在我的 git 配置中列出。
请帮忙!
谢谢
解决方案
如果 URL 是 HTTPS 的,请检查您的git config credential.helper
: if manager, if would have cached, you need to reject its URL
git credential-manager reject
protocol=https
host=github.com
推荐阅读
- r - 使用 mutate() 在每个变量中将 NA 隐藏到单独的级别
- python - TypeError:我的 MYSQL 数据库的格式字符串参数不足
- java - 如何分发 Java 程序并使其安装一次性软件
- c# - 用于内部连接 LINQ 的 Automapper
- python - 如何通过 python 更改注册表项的 DWORD 值?
- python - python类装饰的语义是什么?
- flutter - 即使使用 SingleChildScrollView 在 Flutter 中渲染溢出
- javascript - 路由器问题 Express js 与全局变量
- unity3d - 在 Unity UWP 应用程序中使用 SharpCifs.Std 或 SharpCifs.smb
- javascript - 查找数组中的异常值