使 git 存储库在同一会话中使用其他凭据(使用 Tortoise)

Make a git repository use other credentials than others on the same session (using Tortoise)

是否可以让一个存储库使用与其他存储库不同的一组凭据在同一台机器上使用相同的会话进行推送?

用例:我正在使用朋友的计算机,我的朋友在会话范围内使用 wincred 为项目 A 做贡献,我想在不弄乱他的计算机的情况下为项目 B 做贡献(可能在整个存储库范围内使用 wincred)。我相信我的朋友和他的电脑,我的密码在 origin

我正在使用最新的乌龟 git 2.5,git 用于 windows 2.14 和 wincred

在您的第二个存储库中,您可以:

这将尝试联系 https://yourlogin@server.com 并询问(并缓存)您的凭据。

  • 或者您可以切换到 SSH(不再 "manager")。然后,您需要 ~/.ssh/config (假设您 can/have 在服务器上注册了您的 SSH public 密钥。