Re: Pushing a git repository to a new server
- From
Jeff King <peff@peff.net>
- Date
- Feb 11, 2013, 16:27 UTC
- Message-ID
- <20130211162714.GB16402@sigill.intra.peff.net>
- In-Reply-To
- <CAE_TNin6-weutRDToZ7-BBGJTCcf0dwJn0ChUbFcACRU=SbjzA@mail.gmail.com>
On Mon, Feb 11, 2013 at 02:57:51AM -0500, Ethan Reesor wrote:
Show 8 quoted lines
> On Mon, Feb 11, 2013 at 2:50 AM, Konstantin Khomoutov > <kostix+git@007spb.ru> wrote: > > What's wrong with > > $ ssh myuser@remotehost 'mkdir /path/to/MyRepo.git; cd $_; git init --bare' > > $ git push --all git@remotehost:MyOtherRepo.git > > ? > > Nothing, I just wanted to make myself a command to do that for me.
We talked about this a long time ago. One problem is that it's inherently unportable, as the procedure to make a repo is potentially different on every server (and certainly that is the case between a regular user running stock git and something like GitHub or Google Code; I imagine even gitolite has some special procedures for creating repos, too).
One proposal made in the previous discussion was to define a microformat for repository administration commands. So that you could connect and say "git admin-create-repo /path/to/MyRepo.git", and the server-provided admin-create-repo command would take care of the details. Then stock git could forward it to "git init --bare", GitHub could do the same and create the necessary database records, etc.
And once that standardized method was in place, it would be easy to add a "--create" option to "git push" to request an "admin-create-repo" before pushing.
I still think that's a reasonable way forward, but nobody was interested enough to start writing code for it.
-Peff