Git development
 help / color / mirror / Atom feed
* Starting a new project remotely
@ 2006-01-15 18:45 Daniel Barkalow
  2006-01-15 19:24 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Barkalow @ 2006-01-15 18:45 UTC (permalink / raw)
  To: git

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*

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Starting a new project remotely
  2006-01-15 18:45 Starting a new project remotely Daniel Barkalow
@ 2006-01-15 19:24 ` Junio C Hamano
  2006-01-15 20:01   ` Daniel Barkalow
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-01-15 19:24 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: git

Daniel Barkalow <barkalow@iabervon.org> writes:

> 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.

The "git push" command allows you to push into an empty or even
unrelated destination, but I do think there no wrapper that
creates remotes/ file.  BTW, calling that "origin" is probably
confusing.  In the scenario you outlined, your local side is the
source and the remote is the sink.

FYI, here is what I have in my remotes/ko file to interact with
my kernel.org repository (the one that is mirrored out to the
public machines):

        URL: zzz.kernel.org:/pub/scm/git/git.git/
        Push: master
        Push: +pu
        Push: maint
        Pull: master:refs/tags/ko-master
        Pull: +pu:refs/tags/ko-pu
        Pull: maint:refs/tags/ko-maint

and with this, I first run

	$ git fetch ko
	$ git show-branch master ko-master

to make sure I am not rewinding what I have already pushed out
by mistake, and then

	$ git push ko
        $ git push --tags ko ;# if I added a new tag

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Starting a new project remotely
  2006-01-15 19:24 ` Junio C Hamano
@ 2006-01-15 20:01   ` Daniel Barkalow
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Barkalow @ 2006-01-15 20:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sun, 15 Jan 2006, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > 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.
> 
> The "git push" command allows you to push into an empty or even
> unrelated destination, but I do think there no wrapper that
> creates remotes/ file.  BTW, calling that "origin" is probably
> confusing.  In the scenario you outlined, your local side is the
> source and the remote is the sink.

My general pattern is that I have an "origin" repository, which is public 
and central. I do work in various other repositories, and push the results 
to origin when I finish them. I create these with "git clone", so the 
central point is called "origin" in each clone.

The odd case is when I start out; I have a repository with the initial 
commit, and "origin" is blank. The desired result is that the central 
location gets this commit, and the repository I'm starting from becomes 
identical to any clone of the central location.

I don't create the initial commit in the central location because there's 
no working tree there, and it's a pain to prepare a commit without one. I 
suppose the alternative is to support cloning a blank repository, so I 
could prepare the initial commit just like any later one.

Incidentally, I think it would be useful to have a script that creates a 
remotes/ file given a command line like push or pull. Then you could use 
"git pull" with a long command line until you were happy with the 
behavior, and then make a shortcut out of it. It'd also be nice to have 
the command list the remotes for you as well. If anyone's in the mood for 
scripting and wants something to work on...

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-15 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-15 18:45 Starting a new project remotely Daniel Barkalow
2006-01-15 19:24 ` Junio C Hamano
2006-01-15 20:01   ` Daniel Barkalow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox