git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'upstream' branches.
@ 2007-05-05 12:29 David Woodhouse
  2007-05-05 17:44 ` Alex Riesen
  0 siblings, 1 reply; 13+ messages in thread
From: David Woodhouse @ 2007-05-05 12:29 UTC (permalink / raw)
  To: git

When creating a repository which may pull from one or more 'upstream'
repositories, it's useful to keep 'branches' which keep track of the
last pull from those upstream repositories -- either directly or
indirectly.

At http://www.linux-mtd.infradead.org/doc/git.html I've described the
setup I'm currently using to achieve this, which looks something like
the following:

[remote "origin"]
        url = ssh://git.infradead.org/~/public_git/foo-2.6.git
        fetch = +refs/heads/*:refs/remotes/origin/*
	fetch = +refs/heads/mtd:refs/heads/mtd
	fetch = +refs/heads/linus:refs/heads/linus
        push = refs/heads/master:refs/heads/master
        push = refs/heads/mtd:refs/heads/mtd
        push = refs/heads/linus:refs/heads/linus
[branch "master"]
        remote = origin
        merge = refs/heads/master
[remote "mtd"]
        url = git://git.infradead.org/mtd-2.6.git
        fetch = refs/heads/master:refs/heads/mtd
        fetch = +refs/heads/linus:refs/heads/linus
[remote "linus"]
        url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.$
        fetch = refs/heads/master:refs/heads/linus

Is there a better way to do this? Preferably which doesn't involve
directing the user to edit .git/config directly?

Basically, I want the local 'linus' branch to be updated whenever the
user pulls from _any_ other repository with a 'linus' branch, so that
the 'linus' branch always represents the latest commit pulled from
upstream. Likewise, the 'mtd' branch should be updated when pulling from
that tree (or any other dependent tree which will have an 'mtd' branch).

These branches should be pushed back to the origin each time.

What I have at the moment isn't ideal because I think pulling from the
'mtd' tree will fail if the 'linus' branch there is older than the local
clone's 'linus' branch. But it mostly works.

Is there a better way?

-- 
dwmw2

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

end of thread, other threads:[~2007-05-07  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-05 12:29 'upstream' branches David Woodhouse
2007-05-05 17:44 ` Alex Riesen
2007-05-05 17:50   ` David Woodhouse
2007-05-05 22:52     ` Alex Riesen
2007-05-06  6:36       ` Junio C Hamano
2007-05-06  7:35         ` David Woodhouse
2007-05-06  8:00           ` Junio C Hamano
2007-05-06  8:39             ` David Woodhouse
2007-05-07  1:20               ` Junio C Hamano
2007-05-07  8:51                 ` David Woodhouse
2007-05-06  9:21             ` Alex Riesen
2007-05-07  7:40               ` Junio C Hamano
2007-05-07  8:39                 ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).