Re: git pull and merging.
- From
- Josef Weidendorfer <josef.weidendorfer@gmx.de>
- Date
- Dec 6, 2006, 16:44 UTC
- Message-ID
- <200612061744.31213.Josef.Weidendorfer@gmx.de>
- In-Reply-To
- <cc723f590612060205p1fd26cd7u3c7efc723b0177de@mail.gmail.com>
On Wednesday 06 December 2006 11:05, Aneesh Kumar wrote:
Show 14 quoted lines
> [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/develHowever, "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