# Question about "branch.<name>.merge"

2 messages from 2011-03-18 to 2011-03-18. Participants: Josh Ralburton, Junio C Hamano.
Thread: https://gitlist.dev/t/26778

## Josh Ralburton, 2011-03-18 19:35

Subject: Question about "branch.<name>.merge"
Message-ID: <AANLkTin-96TK_8MjAM7MB4CCyZ0ZSvD=ZanaYWLiXsvC@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTin-96TK_8MjAM7MB4CCyZ0ZSvD%3DZanaYWLiXsvC%40mail.gmail.com

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

```

## Junio C Hamano, 2011-03-18 21:13

Subject: Re: Question about "branch.<name>.merge"
Message-ID: <7vei64w2sa.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vei64w2sa.fsf%40alter.siamese.dyndns.org
In-Reply-To: <AANLkTin-96TK_8MjAM7MB4CCyZ0ZSvD=ZanaYWLiXsvC@mail.gmail.com>

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

```
