-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
authrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauthcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLI
Description
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.
vkaracic, geeseven, balloonio, StanzillaManticore, fdm1 and 301 morebgolinvaux, lilman9716, ncamaa and jtrvEnnel-Foods, santiagotoscanini, alexisromagnoli-halo, utkdmr, siva2204 and 14 morezoidyzoidzoid, eXamadeus, tessus, gui-lendesk, cdmistman and 64 moretonidy, benyapa1493, limonte, tekumara, ethanschoen-jahnel and 24 morewill-camus, tedleyem, tekumara, kannankumar, matheuspolachini and 15 more
Metadata
Metadata
Assignees
Labels
authrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauthcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLI