Git Merging
Kumaresh Chandra Baruri
Software Engineer
Git Merging
Git merging combines sequences of commits into
one unified history of commits. Main merging
types are as below -
 Implicit via rebase or fast-forward merge
 Explicit, non fast-forward merge
 Squash on merge
Fast forward
It merges green branch
Updating 45tP..56tk9
Fast forward some.src | 1 −
1 files changed, 0 insertions(+), 1 deletions(−)
Fast forwarding(Cont…)
Instead of creating a new commit –
git will just point master to the latest commit of
the feature branch.
Master
Feature
Non fast-forward
• Parent branch: master
• Feature branch: feature derived from master.
feature
master
Creates a merge
commit
A new merge commit is created holding other commits.
Squash merge
• Parent branch: master
• Feature branch: feature derived from master.
1 2
feature
master
3
master 6
Before merge
After merge

Variations of git merging

  • 1.
    Git Merging Kumaresh ChandraBaruri Software Engineer
  • 2.
    Git Merging Git mergingcombines sequences of commits into one unified history of commits. Main merging types are as below -  Implicit via rebase or fast-forward merge  Explicit, non fast-forward merge  Squash on merge
  • 3.
    Fast forward It mergesgreen branch Updating 45tP..56tk9 Fast forward some.src | 1 − 1 files changed, 0 insertions(+), 1 deletions(−)
  • 4.
    Fast forwarding(Cont…) Instead ofcreating a new commit – git will just point master to the latest commit of the feature branch. Master Feature
  • 5.
    Non fast-forward • Parentbranch: master • Feature branch: feature derived from master. feature master Creates a merge commit A new merge commit is created holding other commits.
  • 6.
    Squash merge • Parentbranch: master • Feature branch: feature derived from master. 1 2 feature master 3 master 6 Before merge After merge