git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about "branch.<name>.merge"
@ 2011-03-18 19:35 Josh Ralburton
  2011-03-18 21:13 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Josh Ralburton @ 2011-03-18 19:35 UTC (permalink / raw)
  To: git

This is a typical section from a .git config file:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git://git.kernel.org/pub/scm/git/git.git
[branch "master"]
    remote = origin
    merge = refs/heads/master

I am curious why "branch.master.merge=refs/heads/master"  was
implemented to refer to the remote branch (refs/heads/master) rather
than the local branch (refs/remotes/origin/master).

Thanks.

Josh

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

* Re: Question about "branch.<name>.merge"
  2011-03-18 19:35 Question about "branch.<name>.merge" Josh Ralburton
@ 2011-03-18 21:13 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-03-18 21:13 UTC (permalink / raw)
  To: Josh Ralburton; +Cc: git

Josh Ralburton <josh.ralburton@gmail.com> writes:

> This is a typical section from a .git config file:
>
> [remote "origin"]
>     fetch = +refs/heads/*:refs/remotes/origin/*
>     url = git://git.kernel.org/pub/scm/git/git.git
> [branch "master"]
>     remote = origin
>     merge = refs/heads/master
>
> I am curious why "branch.master.merge=refs/heads/master"  was
> implemented to refer to the remote branch (refs/heads/master) rather
> than the local branch (refs/remotes/origin/master).

Because conceptually you are merging with the refs/heads/master branch
that exists at the "origin" repository, not merging with a remote tracking
branch that the "origin" repository may have to track its upstream.

It is immaterial that you happen to have a copy of it at your own remote
tracking branch (i.e. refs/remotes/origin/master).  If you don't need
tracking branches, you can even do something like this:

	[remote "origin"]
                url = git://...there
        [branch "master"]
		remote = origin
                merge = refs/heads/master

Notice that you are telling git not to create any remote tracking branches
with this configuration.

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

end of thread, other threads:[~2011-03-18 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 19:35 Question about "branch.<name>.merge" Josh Ralburton
2011-03-18 21:13 ` Junio C Hamano

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