git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Branch relationships
Date: Mon, 15 May 2006 01:04:46 +0200	[thread overview]
Message-ID: <200605150104.46762.Josef.Weidendorfer@gmx.de> (raw)
In-Reply-To: <7v8xp4ntbf.fsf@assigned-by-dhcp.cox.net>

On Monday 15 May 2006 00:19, you wrote:
> > I suppose "branch.<branch name>.origin" is still the way to go for
> > specifying the upstream?
> 
> Probably "origin" is a better name for it; I was assuming
> "branch.<branch name>.remote = foo" refers to a [remote "foo"]
> section and means "when on this branch, pull from foo and merge
> from it".

Maybe.

But there is a misunderstanding. I wanted the branch attribute "origin"
to specify the upstream _branch_, not a remote.
After a "git clone", we would have

 [remote "origin"]
   url = ...
   fetch = master:origin

 [branch "master"]
   origin = "origin" ; upstream of master is local branch "origin"

 [branch "origin"]
   tracksremote ; bool

Now adding a further development branch for remote branch "topic", we would add

 [remote "origin"]
   ...
   fetch = topic:tracking-topic

 [branch "local-topic"]
   origin = "tracking-topic"

 [branch "tracking-topic"]
   tracksremote

Now, a "git pull" on branch "local-topic" does the right thing: it fetches
from remote "origin", as "tracking-topic" is given in a refspec there, and merges
"tracking-topic" to the current branch "local-topic", as given by the origin
attribute.

This also extends to local upstreams: a "git checkout -b topic2 master" would
append

 [branch "topic2"]
   origin = "master"

and a "git pull" on topic2 would merge the upstream "master".

Josef

  reply	other threads:[~2006-05-14 23:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-13 20:23 git diff: support "-U" and "--unified" options properly Linus Torvalds
2006-05-13 20:30 ` Junio C Hamano
2006-05-13 20:59 ` Junio C Hamano
2006-05-13 21:05   ` Linus Torvalds
2006-05-13 21:22     ` Junio C Hamano
2006-05-13 22:39       ` Linus Torvalds
2006-05-15  0:39         ` Junio C Hamano
2006-05-15  0:58           ` Linus Torvalds
2006-05-15  1:51             ` Junio C Hamano
2006-05-15  3:49             ` Linus Torvalds
2006-05-14  7:00       ` Martin Langhoff
2006-05-14 12:57       ` Josef Weidendorfer
2006-05-14 17:36         ` Junio C Hamano
2006-05-14 20:49           ` Branch relationships (was:Re: git diff: support "-U" and "--unified" options properly) Josef Weidendorfer
2006-05-14 21:20             ` Branch relationships Junio C Hamano
2006-05-14 22:01               ` Josef Weidendorfer
2006-05-14 22:19                 ` Junio C Hamano
2006-05-14 23:04                   ` Josef Weidendorfer [this message]
2006-05-14 23:55                     ` Junio C Hamano
2006-05-15  1:48                       ` Josef Weidendorfer
2006-05-15  2:11                         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605150104.46762.Josef.Weidendorfer@gmx.de \
    --to=josef.weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).