git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Pushing a git repository to a new server

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 12, 2013, 11:28 UTC
Message-ID
<511A2775.9050209@drmicha.warpmail.net>
In-Reply-To
<20130211162714.GB16402@sigill.intra.peff.net>
Jeff King venit, vidit, dixit 11.02.2013 17:27:
Show 34 quoted lines
> On Mon, Feb 11, 2013 at 02:57:51AM -0500, Ethan Reesor wrote:
> 
>> 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
> 

I'm not sure providers like GitHub would fancy an interface which allows the programmatic creation of repos (giving a new meaning to "fork bomb"). But I bet you know better ;-)

An alternative would be to teach git (the client) about repo types and how to create them. After all, a repo URL "ssh://host/path" gives a clear indication that "ssh host git init path" will create a repo. I'm wondering whether it's more likely to convince providers (the server side) or more is gained by covering the simpler cases client-side (our side).

Michael
Previous: Ethan ReesorNext: Jeff King
Message 8 of 10 in “Pushing a git repository to a new server”
  1. Ethan ReesorFeb 10, 2013
  2. Konstantin KhomoutovFeb 11, 2013
  3. Ethan ReesorFeb 11, 2013
  4. Konstantin KhomoutovFeb 11, 2013
  5. Ethan ReesorFeb 11, 2013
  6. Jeff KingFeb 11, 2013
  7. Ethan ReesorFeb 11, 2013
  8. Michael J GruberFeb 12, 2013
  9. Jeff KingFeb 12, 2013
  10. Michael J GruberFeb 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.