Does GIT merges based on datetime? -


i understand how git merge happens.

master & feature

a--b--c --g--h--i         --d--e--f 

here changes made , date when changed.

g(master) - aug - 8th h(master) - aug - 10th i(master) - aug - 15th

d(feature) - aug - 9th e(feature) - aug - 11th f(feature) - aug - 12th

so, if merge master branch feature how history appear? merge based on date change , display this?

feature branch

a--b--c--g--d--h--e--f 

the way git merge creates if will, patch of diff between current branch , branch trying merge. applies patch whole branch commit -

merge "source branch" "target branch" 

this new commit having. if want revert --d--e--f don't revert them individually, revert big merge commit.

as time stamp, yes git give merge of commits in both branches can revert yourself.

so imagine this,

branch 1: - b - c -           - g - h - branch 2:             d - e - f 

merging these in branch 1 give -

branch 1: - b - c - d - e - f - g - h - - j (here, j = d + e + f) 

on other hand, rebase give :

branch 1: - b - c - g - h - - j - d* - e* - f* (here, d* = d's changes) 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -