Thread (14 messages) 14 messages, 7 authors, 2016-08-11

Re: git pull and merging.

flat view

From: Josef Weidendorfer <hidden>
Date: 2016-08-11 20:08:43

On Wednesday 06 December 2006 11:05, Aneesh Kumar wrote:
[branch "devel"]
        remote = origin
        merge = devel

[....]
Now i thought merge should be local reference. So i changed it to
merge = remotes/origin/devel.

That also didn't work.

Then i tried the name of the branch should be indicated as
"refs/heads/devel" . That also didn't work.

So i guess i am missing something.
See man page of git-repo-config:

 branch.<name>.merge
  When in branch <name>, it tells git fetch the default
  remote branch to be merged.

I assume that the "devel" branch on the remote repo you cloned from
is also "devel", more exactly "refs/heads/devel".

Now, instead of "git pull", git should default to

	git pull origin refs/heads/devel:refs/remotes/origin/devel

ie. it should update the local tracking branch "refs/remotes/origin/devel"
with the remote branch "refs/heads/devel".
The tracking branch "refs/remotes/origin/devel" will be merged with current
branch afterwards.

Now looking at the documentation for branch.<name>.merge, it talks
about the remote branch, which is "refs/heads/devel" in your case, ie.
the first part of the refspec of the full "git pull" command above.

So, as you already posted (without explanation, therefore this mail),
the config should be

 [branch "devel"]
         remote = origin
         merge = refs/heads/devel

However, "devel" alone should work here, as it can be matched with remote
"refs/heads/devel". Seems to be a bug, as branch.<name>.merge seems to only
being compared with the full canonical name in the implementation.

Josef
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help