git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git pull and merging.

From
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Date
Dec 7, 2006, 06:46 UTC
Message-ID
<4577B8C0.3060200@gmail.com>
In-Reply-To
<200612061744.31213.Josef.Weidendorfer@gmx.de>
Josef Weidendorfer wrote:
Show 28 quoted lines
> 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
this means the remote reference is refs/heads/devel and local tracking branch for that is refs/remotes/origin/devel.
Show 6 quoted lines
> 
> 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.
> 
That will be merged is the tricky part. 
> 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.
> 

This is most confusing part. What merge indicate is not about refs/heads/devel should track refs/remotes/origin/devel. That is specfied in the remote config option.

What merge indicate is that when in a local branch ( not the tracking one under remotes/origin) which branch from remote need to be used to merge to the local branch.

Show 10 quoted lines
> 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.
I guess we need to have a standard way of saying the branches. 
May be we want to document it in repo-config.

local branch on which changes can be made <branch-name> local tracking branch refs/remotes/<remote-name>/<branch-name> remote branch refs/heads/<branch-name>

Previous: Josef WeidendorferNext: Josef Weidendorfer
Message 11 of 36 in “git pull and merging.”
  1. Aneesh KumarDec 6, 2006
  2. Junio C HamanoDec 6, 2006
  3. Aneesh KumarDec 6, 2006
  4. Johannes SchindelinDec 6, 2006
  5. Peter BaumannDec 6, 2006
  6. Johannes SchindelinDec 6, 2006
  7. Peter BaumannDec 6, 2006
  8. Aneesh KumarDec 6, 2006
  9. Jakub NarebskiDec 6, 2006
  10. Josef WeidendorferDec 6, 2006
  11. Aneesh Kumar K.VDec 7, 2006
  12. Josef WeidendorferDec 7, 2006
  13. Junio C HamanoDec 7, 2006
  14. Josef WeidendorferDec 7, 2006
  15. Santi BéjarDec 8, 2006
  16. Josef WeidendorferDec 8, 2006
  17. Add branch.*.localmerge and documentation updateJosef Weidendorfer, Dec 8, 2006
  18. Santi BéjarDec 8, 2006
  19. Junio C HamanoDec 8, 2006
  20. Jakub NarebskiDec 8, 2006
  21. Josef WeidendorferDec 8, 2006
  22. Junio C HamanoDec 8, 2006
  23. Josef WeidendorferDec 8, 2006
  24. Junio C HamanoDec 8, 2006
  25. Add branch.*.merge warning and documentation updateJosef Weidendorfer, Dec 9, 2006
  26. Santi BéjarDec 9, 2006
  27. Josef WeidendorferDec 8, 2006
  28. Santi BéjarDec 8, 2006
  29. Santi BéjarDec 8, 2006
  30. Junio C HamanoDec 8, 2006
  31. Junio C HamanoDec 7, 2006
  32. Santi BéjarDec 8, 2006
  33. Jakub NarebskiDec 8, 2006
  34. Jakub NarebskiDec 6, 2006
  35. Johannes SchindelinDec 6, 2006
  36. Fwd: git pull and merging.Aneesh Kumar, Dec 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.