Reputation: 1903
Is it possible to have one repository use a different set of credentials for pushing than others on the same machine, with the same session?
Use case: I am using a friend's computer, my friend contributes to project A using wincred session-wide, and I would like to contribute to project B without messing up his computer (possibly using wincred repository-wide). I trust my friend and his computer with my password on origin
I am using an up-to-date tortoise git 2.5 with git for windows 2.14 and wincred
Upvotes: 1
Views: 155
Reputation: 1323553
In your second repo, you can either:
enable Git Credential Manager (after installing it), and use as an https URL: https://[email protected]/auser/gitrepo
git remote set-url origin https://[email protected]/auser/gitrepo
git ls-remote
That will attempts to contact https://[email protected] and will ask (and cache) your credentials.
~/.ssh/config
correctly configured (provided you can/have register(ed) your SSH public key on the server.Upvotes: 1