Re: [PATCH v2] ssh: add 'ssh.keyfile' option
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Apr 23, 2020, 17:24 UTC
- Message-ID
- <d26f8556-ed9b-5145-735b-d348449bb31d@kdbg.org>
- In-Reply-To
- <20200423112110.45405-1-ray@ameretat.dev>
Am 23.04.20 um 13:21 schrieb Raymond E. Pasco:
> When a specific private key needs to be used with a repository, manually > specifying it via 'core.sshCommand' is not ideal. This option allows a > keyfile to be specified in the local configuration. If a keyfile is > specified, SSH agents are disabled for the command.
You can do this without modifying Git. Say, your key file is ~/.ssh/id_other_ed25519, then do this:
Rename your remote to use an invented host name:
git remote set-url origin git@other.github.com:other/repo
Then attach the invented name to the real host name and the identity in your ~/.ssh/config:
Host other.github.com
Hostname github.com
Identity ~/.ssh/id_other_ed25519-- Hannes