[dev] Fwd: Rebase vs. Merge

Ben Klang ben at alkaloid.net
Wed Jan 13 19:14:37 UTC 2010


On Jan 13, 2010, at 2:04 PM, Michael M Slusarz wrote:

> Quoting Ben Klang <ben at alkaloid.net>:
> 
>> I can do a "git pull --rebase" but now I've got changesets from "master" in my local branch:
>> $ git status
>> # On branch TestBranch
>> # Your branch is ahead of 'origin/TestBranch' by 19 commits.
>> #
>> 
>> This is verified by viewing the repository in GitX and seeing duplicate commits from origin/master: 1 each in master and TestBranch.
> 
> These duplicate messages are expected.  The commit hashes in TestBranch aren't identical to the hashes in master, since commit hashes are generated based on the tree status.  Since you have altered a file in TestBranch vs. master, the trees are different.  However, git can easily detect that these commits are identical when doing various reports (see, e.g., git cherry).
> 
> Preventing reporting of these various commits is precisely what Mike R. was working on in the commit message script this week.
I see.  It makes reading the changelog harder because the branch's commits are mixed in with the rebase from master, but I guess we'll just have to live with that for remote branches.  For local branches the "pull --rebase" isn't necessary so the changelog stays cleaner.   But at least the delta between the branch and the master will be only the branch's changes.

/BAK/
-- 
Ben Klang
Alkaloid Networks LLC
ben at alkaloid.net
404.475.4850
http://projects.alkaloid.net




More information about the dev mailing list