From: Konstantin Khomoutov <flatworm@users.sourceforge.net>
To: Mark Hills <Mark.Hills@framestore.com>
Cc: git@vger.kernel.org
Subject: Re: Clone to an SSH destination
Date: Mon, 3 Sep 2012 15:47:32 +0400 [thread overview]
Message-ID: <20120903154732.5fb50b173fa51db8300624b3@domain007.com> (raw)
In-Reply-To: <alpine.LFD.2.01.1209031059480.4753@sys880.ldn.framestore.com>
On Mon, 3 Sep 2012 11:21:43 +0100 (BST)
Mark Hills <Mark.Hills@framestore.com> wrote:
> How do I clone a repo _to_ a new repo over SSH? I tried:
>
> cd xx
> git clone --bare . gitserver:/scm/xx.git
> git clone --bare . ssh://gitserver/scm/xx.git
>
> This does not have the expected result, and instead a local path of
> the given name is created (eg. a 'gitserver:' directory)
No, `git clone` is intended to work with your local machine.
And I can't really imagine how it would work in a way you want.
> This seems to be a FAQ, but the only answer I can find (Google) is to
> login to the server and create the repo, setup a remote and push to
> it.
> This is quite cumbersome; we have a large team of devs who use a
> simple 'git clone' to an NFS directory, but we wish to retire NFS
> access.
>
> Is there a technical limiation preventing clone-to-ssh, or just
> something waiting to be implemented?
I think this is more a conceptual issue: such a "remote cloning" would
mean *creation* of a repository as part of the process. I'm not aware
of any [D]VCS system which would routinely allow such a thing: usually
the creation of a repository is an "administrative" act, which is
distinct from regular (push/fetch) access to that repository.
gitolite kind of implements this ("wild repos") [1], you could look if
it suits your needs.
Now back to your problem.
If you have NFS access, you can probably do proper cloning using NFS:
1) Export via NFS the directory in which you want your resulting
bare repository located.
2) Do simple *local* clone (using paths accessed by NFS):
git clone --bare /path/to/source/repo /path/to/destination/repo
3) Do certain fixups in the destination repo, if needed, then
access it normally via SSH (or whatever protocol you prefer).
If you don't want to do this, then revert to a normal two-step
procedure:
1) Log into the server, create a repo by hand:
git init --bare /path/to/repo
2) Push everything relevant from a source repo there:
cd /path/to/local/repo
git remote add origin ssh://gitserver/scm/xx.git
git push origin refs/*:refs/*
Step (1) may depends on what server-side solution your need; for
instance, in gitolite you would be configuring a new repo in the
configuration file in your local clone of the gitolite admin repo and
pushing your changes to the server.
1. http://sitaramc.github.com/gitolite/wild.html
next prev parent reply other threads:[~2012-09-03 11:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 10:21 Clone to an SSH destination Mark Hills
2012-09-03 11:26 ` Ævar Arnfjörð Bjarmason
2012-09-03 13:07 ` Mark Hills
2012-09-03 14:08 ` Konstantin Khomoutov
2012-09-03 14:26 ` Sitaram Chamarty
2012-09-03 14:27 ` Enrico Weigelt
2012-09-03 11:47 ` Konstantin Khomoutov [this message]
2012-09-03 12:54 ` Sitaram Chamarty
2012-09-03 13:15 ` Mark Hills
2012-09-03 13:48 ` Sitaram Chamarty
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=20120903154732.5fb50b173fa51db8300624b3@domain007.com \
--to=flatworm@users.sourceforge.net \
--cc=Mark.Hills@framestore.com \
--cc=git@vger.kernel.org \
/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