我必须能够在两个上下文中执行Git命令:
除了推送/拉取操作之外,一切都很完美,其中存在凭证助手问题.使用默认设置GitHub的,它使用helper = !github –credentials的etc/.gitconfig,远程OPS工作的优良背景1,但不是上下文2(它每次都要求提供凭据).如果我想补充helper = wincred到user/.gitconfig,然后情境1个工作正常和上下文2项优良工程虽然第一抱怨:
github --credentials get: github: command not found
github --credentials store: github: command not found
Run Code Online (Sandbox Code Playgroud)
(我假设它抱怨因为它试图使用GitHub帮助器但不能在上下文2中)但是然后继续执行推送:
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 467 bytes | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
...
Run Code Online (Sandbox Code Playgroud)
我可以投诉现场,但问题是,每当启动GitHub上的Windows,它会删除helper = wincred从user/.gitconfig.
问题是:我可以吗?