![](/img/trans.png)
[英]Fetch, pull, merge or push a change to GitHub gitbash gives {git: 'credential-cache' is not a git command. See 'git — help'.}
[英]git-credential-winstore.exe for two GitHub logins?
我使用git-credential-winstore (与msysgit 一起安装)在Window的凭证存储中存储我的个人GitHub帐户详细信息(控制面板 - >用户帐户 - >管理您的凭据 - > Windows凭据)我现在尝试使用第二个GitHub帐户。 我已经修改了本地git.config( git config user.name "foo"
)但是当我推送时,它仍然试图使用个人GitHub凭据。 我知道我可以将存储库URL从https://github.com/user/project.git更改为https:// user:password@github.com/user/project.git ,但我宁愿不采取安全措施通过在git.config中嵌入凭据来冒险。 我知道我可以进入控制面板并来回翻转凭据,但这真的很烦人。 有没有办法在git-credential-winstore中存储多个GitHub帐户详细信息,并将每个repo配置为使用其中一个?
我已经分叉了git-credential-winstore来支持多个github登录。 你可以在这里找到我的分支: https : //gitcredentialstore.codeplex.com/SourceControl/network/forks/nickmeldrum/gitcredentialstore
(我已经向原作者发送了拉取请求,但看起来他不再接受它们/维护项目了。)
使用我的fork最简单的方法是:
git clone https://git01.codeplex.com/gitcredentialstore
msbuild.exe .\\git-credential-winstore.sln
) InstallLocalBuild.cmd
以设置git以使用此版本的凭证帮助程序 如果有人真的使用这个fork并告诉我它,我会在codeplex中设置一个正确的二进制下载!
为了使其工作,您需要告诉git您要用于连接到该repo中该特定远程的用户名。 您可以通过在远程URL中指定它来实现。 例如:
git remote set-url origin https://username@github.com/username/repository.git
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.