DevOps Classroom Series – 04/Jul/2021

How Git Works

  • HEAD file in .git folder represents the branch. It should ideally point towards the branch. If HEAD is pointing to some commit rather than branch it is called as DETACHED HEAD state
  • Use the class room recording to understand the git traversal across commits to populate working directory

Merging Branches

  • Fast-Forward: When branch moves to the latest commit of branch which we are merging from i.e considered as fast forward Preview

  • Merge: This creates an extra commit on the destination branch which has merge commit (which has two parents) Preview

  • Lets assume we have the branch which looks as shown below Preview

  • Now lets assume the user has created one more commit Preview

  • Now we need to have whatever changes which we have done on v2.0 branch in master branch also

  • Steps for merging.

    • Checkout to the branch where we need to merge git checkout <dest-branch>
    • Now execute the command git merge <source-branch> Preview
  • Now Contents of V1.0 branch needs to be merge to master branch Preview Preview

  • Next Steps:

    • Searching for history and differences in commandline
    • Merge Conflicts
    • Cherry-pick
    • Re-base
    • Add the Remote Repository

Leave a Reply

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

About learningthoughtsadmin