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

Starting a new project remotely

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 15, 2006, 18:45 UTC
Message-ID
<Pine.LNX.4.64.0601151323320.25300@iabervon.org>

Is there something currently that acts like git-clone, except that it sets up automatic connections in the opposite direction? That is, you run it in a repository with no origin, and it pushes the data to the specified location (which probably needs to be set up already as an empty repository) and sets the local side's origin remote to the location given.

This recipe seems to work:
 git branch origin master
 echo >$GIT_DIR/remotes/origin \
"URL: $repo
Pull: $head_points_at:$origin"
 git push origin $origin:refs/heads/$head_points_at

(where $origin is "origin", $head_points_at is "master", $repo is the target repository, "origin" is the remote you want to create, and "master" is the head that currently holds the commit you want to push)

	-Daniel
*This .sig left intentionally blank*
Next: Junio C Hamano
Message 1 of 3 in “Starting a new project remotely”
  1. Daniel BarkalowJan 15, 2006
  2. Junio C HamanoJan 15, 2006
  3. Daniel BarkalowJan 15, 2006

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.