Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Basin Ilya
Wow, thanks. For me it was enough to configure just one rewrite, because my public github account is associated with my default key. Note that I added the missing slash and the username: git config --global \ url.git@gh-org:theorganization/.insteadOf \

Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Jeff King
On Thu, Jul 19, 2018 at 02:50:16PM +0200, Ævar Arnfjörð Bjarmason wrote: > > I thought of writing a wrapper script to deduce the key from the arguments: > > > > g...@github.com git-upload-pack '/theorganization/privaterepo.git' > > > > Is this the only option? > > Yes, I had a similar

Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Jeff King
On Thu, Jul 19, 2018 at 03:24:54PM +0300, Basin Ilya wrote: > I have two github accounts, one is for my organization and I want git > to automatically choose the correct ssh `IdentityFile` based on the > clone URL: > > g...@github.com:other/publicrepo.git >~/.ssh/id_rsa >

Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Sitaram Chamarty
On 07/19/2018 06:52 PM, Sitaram Chamarty wrote: > On Thu, Jul 19, 2018 at 03:24:54PM +0300, Basin Ilya wrote: >> Hi. >> >> I have two github accounts, one is for my organization and I want git to >> automatically choose the correct ssh `IdentityFile` based on the clone URL: >> >>

Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Sitaram Chamarty
On Thu, Jul 19, 2018 at 03:24:54PM +0300, Basin Ilya wrote: > Hi. > > I have two github accounts, one is for my organization and I want git to > automatically choose the correct ssh `IdentityFile` based on the clone URL: > > g...@github.com:other/publicrepo.git >~/.ssh/id_rsa >

Re: Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Ævar Arnfjörð Bjarmason
On Thu, Jul 19 2018, Basin Ilya wrote: > Hi. > > I have two github accounts, one is for my organization and I want git to > automatically choose the correct ssh `IdentityFile` based on the clone URL: > > g...@github.com:other/publicrepo.git >~/.ssh/id_rsa >

Use different ssh keys for different github repos (per-url sshCommand)

2018-07-19 Thread Basin Ilya
Hi. I have two github accounts, one is for my organization and I want git to automatically choose the correct ssh `IdentityFile` based on the clone URL: g...@github.com:other/publicrepo.git ~/.ssh/id_rsa g...@github.com:theorganization/privaterepo.git