git - What is the difference between merging master into branch and merging branch into master? -
i have branch called master
, called dev
. usually, tests , improvements on dev
, , when decided ok, merge master
, tagging , release new version of application. met 2 cases of merging:
master
dev
, and merge dev
master
, but not sure how 2 different... explanation welcome.
merging 1 branch not symmetric operation:
mergingdev
master
, and merging master
dev
, are, in general, not equivalent. here illustrative illustration explains difference between two. let's assume repo looks follows:
if mergedev
master
if master
checked out (git checkout master
),
and merge dev
(git merge dev
), end in next situation:
the master
branch points new merge commit (f
), whereas dev
still points same commit (e
) did before merge.
master
dev
if, on other hand, dev
checked out (git checkout dev
),
and merge master
(git merge master
), end in next situation:
the dev
branch points new merge commit (f'
, whereas master
still points same commit did before merge (d
).
git merge
No comments:
Post a Comment