DevOps Classroomnotes 14/Sep/2022

Merging changes between two branches

  • Consider the following DAG
    Preview
  • We have create a new branch poc_1.
  • Done some commits, the master branch didn’t change
  • Now when we merge, it would be enough if the master starts pointing towards the latest commit of poc_1 branch.
  • This is called as Fast Forward
    Preview
  • To merge the changes, switch to the branch you want to merge changes to (destination) and then execute command git merge <source-branch>
git checkout master
git merge poc_1

Preview
* We can skip fast forwarding git merge <source-branch> --no-ff

  • Consider the following DAG
    Preview
  • Git history
    Preview
  • Now we want changes done in poc_1 branch onto master
  • When merging the changes, automatic merges by git will fail when there are conflicting situations which are referred as merge-conflicts
    Preview
    Preview
  • Fix the changes
    Preview
    Preview
    Preview
  • This way of merging is referred as three way merge
  • Consider the following DAG
    Preview
  • After create the POC_1 from master branch, an important commit that needs to be part of POC_1 is committed to master.
    Preview
    Preview
    Preview
    Preview
  • DAG
    Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner