Git Pull vs Git Pull Rebase

Suppose originally there were 3 commits, A,B,C:
A-B-C
Then developer D created commit D, and developer E created commit E:
A-B-C-D-E
Obviously, this conflict should be resolved somehow. For this, there are 2 ways:
MERGE:
A-B-C-D-E-M
Both commits D and E are still here, but we create merge commit M that inherits changes from both D and E. However, this creates diamond shape, which many people find very confusing.
REBASE:
A-B-C-D-E-R
We create commit R, which actual file content is identical to that of merge commit M above. But, we get rid of commit E, like it never existed (denoted by dots - vanishing line). Because of this obliteration, E should be local to developer Ed and should have never been pushed to any other repository. Advantage of rebase is that diamond shape is avoided, and history stays nice straight line - most developers love that!

Comments

Popular posts from this blog

A Ten Year Journey: How SEO PowerSuite Has Kept Its SEO Tools Current

Create Separate Contact Page in Blogger

HACK WEBSITE USING SQLMAP | KALI LINUX - BACKTRACK