From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "Raymond E. Pasco" <ray@ameretat.dev>, git@vger.kernel.org
Subject: Re: [PATCH v2] ssh: add 'ssh.keyfile' option
Date: Thu, 23 Apr 2020 12:32:06 -0700 [thread overview]
Message-ID: <xmqqimhqgfrd.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <d26f8556-ed9b-5145-735b-d348449bb31d@kdbg.org> (Johannes Sixt's message of "Thu, 23 Apr 2020 19:24:09 +0200")
Johannes Sixt <j6t@kdbg.org> writes:
> 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
Nice. I wonder if this answer (and answers to other "how would I
use .ssh/config to adjust Git to suite my use?" questions people may
often ask) can be put in some of our documentation.
next prev parent reply other threads:[~2020-04-23 19:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 6:41 [PATCH] ssh: add 'ssh.keyfile' option Raymond E. Pasco
2020-04-23 11:21 ` [PATCH v2] " Raymond E. Pasco
2020-04-23 17:24 ` Johannes Sixt
2020-04-23 19:32 ` Junio C Hamano [this message]
2020-04-24 3:24 ` Raymond E. Pasco
2020-04-23 18:03 ` Matthias Aßhauer
2020-04-23 19:38 ` Junio C Hamano
2020-04-24 4:33 ` Matthias Aßhauer
2020-04-25 9:43 ` [PATCH] connect.c: clarify BUG() messages in push_ssh_options Matthias Aßhauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqimhqgfrd.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=ray@ameretat.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).