3 ms·
Can different .git-credentials files also be loaded conditionally? When one uses https access with multiple accounts....
by vanous 3y ago
Can different .git-credentials files also be loaded conditionally? When one uses https access with multiple accounts....
- sp1rit 3y agoYou could probably write a custom git credential helper that does that, if it doesn't exist already.
- lathiat 3y agoDo you need multiple files? Since you can store credentials for multipl users and host combinations in the same file.
- deleted 3y ago[deleted]
- akdor1154 3y agoI use the technique in article for something similar that solves the same problem. I'll find it on pc in a sec.
- akdor1154 3y ago~/.gitconfig: [credential] credentialStore = secretservice helper = /usr/local/bin/git-credential-libsecret [credential "https://github.com"] username = akdor1154 [includeif "gitdir:~/src/mywork/"] path=~/src/mywork/.gitconfig ~/src/mywork/.gitconfig: [user] email = "12345+akdor1154-mywork@users.noreply.github.com" signingkey = ~/.ssh/id_rsa.mywork.private [credential "https://github.com"] username = akdor1154-mywork The `username` is passed to the global secret helper and is thus used for it as part of the pick/prompt context for password. I'm using the libsecret helper but this works with any.