From: Shawn Pearce <spearce@spearce.org>
To: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: git@vger.kernel.org
Subject: Re: how to pass ssh options to git?
Date: Thu, 2 Nov 2006 15:22:30 -0500 [thread overview]
Message-ID: <20061102202230.GA21456@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0611020801160.25218@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
> It's really better to use a ".ssh/config" file instead.
>
> I realize that you want to use different options "dynamically", but what
> you can do is to just have different "fake hostnames". For example, you
> can do
>
> Host private.host.com
> User myname
> Hostname host.com
> IdentityFile /home/myname/.ssh/private-identity
> Host public.host.com
> User groupname
> Hostname host.com
> IdentityFile /home/myname/.ssh/public-identity
I often setup not only multiple fake hostnames in my .ssh/config
but I also setup multiple remote files under any given repository's
.git/remotes directory, using one file per fake hostname.
That way I can pick which options to apply at the time of git push
or git fetch by just changing the name passed to it.
$ ls .git/remotes
private public
$ cat .git/remotes/private
URL: private.host.com:/path/to/repo
Pull: refs/heads/master:refs/heads/origin
$ cat .git/remotes/public
URL: public.host.com:/path/to/repo
Pull: refs/heads/master:refs/heads/origin
$ git push private
$ git fetch public
I often need this to traverse around firewalls and whatnot.
It works pretty well, assuming I can remember where I'm currently
connected to. :-)
--
next prev parent reply other threads:[~2006-11-02 20:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-02 9:07 how to pass ssh options to git? Michael S. Tsirkin
2006-11-02 9:20 ` Matthieu Moy
2006-11-02 9:31 ` Michael S. Tsirkin
2006-11-02 11:06 ` Dennis Stosberg
2006-11-02 11:27 ` Michael S. Tsirkin
2006-11-02 16:10 ` Linus Torvalds
2006-11-02 20:22 ` Shawn Pearce [this message]
2006-11-02 11:18 ` Nicolas Vilz 'niv'
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=20061102202230.GA21456@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=mst@mellanox.co.il \
/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