Describe the feature or problem you’d like to solve
I have two accounts on github each with access to a different set of private repositories. Currently I use a combination of git's [IncludeIf ...] config and a custom config which overrides the SSH private key I use for certain repositories. E.g.:
In ~/.gitconfig:
[includeIf "gitdir:~/work/"]
path = ~/work/.gitconfig
and in ~/work/.gitconfig:
[core]
sshCommand = "ssh -i ~/.ssh/work"
It will be great if the credentials for gh can also be configured per repository as well.
Proposed solution
There are a bunch of options I can think of:
- Allow overriding
gh config by a file in a local clone's .git directory
- Allow defining rules in the
gh config which defines which repos/orgs should use which credential. E.g.
github.com/google:
- user: gemployee
oauth_token: ...
github.com/microsoft:
- user: msemployee
oauth_token: ...
github.com:
- user: personal
oauth_token: ...
How will it benefit CLI and its users?
It will allow Github users with multiple accounts of varying access to seamlessly work on different repositories.
Describe the feature or problem you’d like to solve
I have two accounts on github each with access to a different set of private repositories. Currently I use a combination of git's
[IncludeIf ...]config and a custom config which overrides the SSH private key I use for certain repositories. E.g.:In
~/.gitconfig:and in
~/work/.gitconfig:It will be great if the credentials for
ghcan also be configured per repository as well.Proposed solution
There are a bunch of options I can think of:
ghconfig by a file in a local clone's.gitdirectoryghconfig which defines which repos/orgs should use which credential. E.g.How will it benefit CLI and its users?
It will allow Github users with multiple accounts of varying access to seamlessly work on different repositories.