DevOps Classroomnotes 22/Feb/2023

Git Branching

  • Create a new folder and make it a repository
  • add one commit and rename the default branch to main
  • create one more commit on main
  • Lets create a branch called as sprint0
  • lets make one change in sprint0 in src/

Fast Forward Merge

  • We want changes done in sprint0 to be merged to main
  • The merge command is git merge <source-branch> i.e. you should be in target branch
  • Fast forward merge happened which moves the main to the latest commit of sprint 0 branch.
  • Before Merge
  • After Merge

Three Way Merge

  • Lets create a commit on main branch and git graph should be as shown below
  • Current view
  • Lets merge the changes into main
  • We get merge conflict as line 1 of src/ is conflicting
  • now make the changes and add them to staging area and commit to create a merge commit
  • Merge commit is a special commit, which has two parents
  • note: IF you are new to vi editor Refer Here


  • Create a git repository
  • create three files called as in
    • src
    • test
    • build
  • create a commit
  • create one more commit by editing in src
  • main will have two commits
  • represent this in graph with HEAD and master in the graph
  • Now create a branch sprint0 from master
  • From sprint0 create two branches
    • sprint0_poc
    • sprint0_dev
  • Update the same in graph
  • Now checkout to sprint0_poc and create a folder called as poc with, update the graph
  • Now checkout to sprint0_dev and create a file src/
  • merge changes from sprint0_poc tp sprint0_dev
  • Delete the sprint0_dev

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner