19 Jan 2017

Understanding a merge commit - git

This is what I sent today to my colleagues while explaining the reason for mysterious changes in a pull-request
That blank merge commit is the culprit. All changes which should be result of merge are blown away.
Explanation:-
First let's understand that a merge commit is also a commit with changes. Changes in source branch since its diversion (from destination branch) are auto-magically done as part of merge commit in destination branch. 
So a merge occurred without any changes (if its been blown away as it has been the case) in merge commit, is basically a reversal of all changes that have occurred in source branch since the destination branch diverged from it. Hope this clarifies the mystery.
To visualise how chain of commits are formed, diverged and merged, you can refer to the image in Understanding what GIT does under the hood rather than only learning commands and wondering

6 comments:

  1. Thanks for sharing the article, its really useful. Keep updating more with us.

    ReplyDelete
  2. Expert Web Solutions a top leading website designing company in tilak nagar, delhi. we are providing cheapest web designing service company in delhi and all over india. Website designing company in janakpuri. VIEW MORE :- Website designing company Delhi

    ReplyDelete
  3. Expert Web Solutions a top leading website designing company in tilak nagar, delhi. we are providing cheapest web designing service company in delhi and all over india. Website designing company in janakpuri. VIEW MORE :- Web Designing Company in India

    ReplyDelete
  4. Awesome blog post thanks for sharing very informative post
    . VIEW MORE :- web designing companies in delhi

    ReplyDelete
  5. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job
    Shri Ram Packaging Industry is one of the Leading Manufactures & suppliers of International standard pinewood pallets, Euro Pallets, ISPM-15 Heat Treated wooden Pallets, Crates, boxes since last 4 decade in Gurgaon, Bhiwadi.VIEW MORE
    Paper Angle Board Manufacturer in Neemrana

    ReplyDelete