Git Pull vs Git Pull Rebase
Suppose originally there were 3 commits,
A
,B
,C
:
Then developer D created commit
D
, and developer E created commit E
:
Obviously, this conflict should be resolved somehow. For this, there are 2 ways:
MERGE:
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:
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
best laptop for students
best gaming laptop under 50k
best gaming laptop under 50000
best laptop under 50k
best laptop under 40K
best laptop under 40,000
best smartphones under 10000
best smartphones under 10k
best gaming smartphones under 10000
best camera smartphones under 10000
best camera smartphones under 15000
best gaming smartphones under 15000
best battery smartphones under 15000
best camera smartphones under 15k
best gaming smartphones under 15k
best battery smartphones under 15k
best smartphones under 15k