【发布时间】:2020-10-27 16:58:48
【问题描述】:
这里有两个不同的用户在 github.com
- "user-one" (one@mail.com)
- “用户二”(two@mail.com)
每个用户都有自己的存储库,其中包含不同的项目帐户
现在我的电脑上有我:我想将本地配置设置为
- "folder-one" 定位 repo-one 以上传项目更改,因此:
- git config --local user.name "user-one"
- git config --local user.email one@mail.com
- “folder-two”针对 repo-2 上传项目更改,所以:
- git config --local user.name "user-two"
- git config --local user.email two@mail.com
当我推送到“repo-one”时,GitHub 会在我的计算机中安装一个凭据(如 git:https://github.com),让我只能将更改上传到该 repo。
问题
每次我推送到不同的存储库时,我都可以解决删除该凭据的问题,但是有更好的方法吗?有什么方法可以保存每个新用户数据而不是拒绝我的访问?
解决方案建议
如何让 GitHub 知道我将处理不同的帐户,这些帐户将向他们推送各自不同的存储库?
【问题讨论】:
标签: github github-actions git