{"id":3829,"date":"2011-06-07T17:19:54","date_gmt":"2011-06-07T11:49:54","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=3829"},"modified":"2016-12-19T15:16:38","modified_gmt":"2016-12-19T09:46:38","slug":"using-git-diff-feature-on-github","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/using-git-diff-feature-on-github\/","title":{"rendered":"Using git diff feature on Github"},"content":{"rendered":"<p style=\"padding-bottom: 10px\">Hi Folks,<\/p>\n<p style=\"padding-bottom: 10px\">Recently I came across a cool way to compare differences between two branches, two tags, or between two commits on Github. Many a times in our project we have to thoroughly see what has been a specific change in the code base before we push it on our production branch.<\/p>\n<p style=\"padding-bottom: 10px\">Here is how you can view the differences in commits:<\/p>\n<p style=\"padding-bottom: 10px\">On the Github, go to the <strong>Source<\/strong> view of your project. You will see a link named <strong>&#8216;Branch List&#8217;<\/strong>. Once the page opens you can see a list of all the remote branches. Hit on the Compare button in front of any of the available branches to see the difference between two branches.<\/p>\n<p style=\"padding-bottom: 10px\">Now note the URL in the address bar. It should end with something like &#8216;&#8230;\/compare\/&lt;x&gt;&#8230;&lt;y&gt;&#8217;  where <strong><em>x<\/em><\/strong> and <strong><em>y<\/em><\/strong> are separated by three dots(&#8230;) and their values could be project&#8217;s branch names<\/p>\n<p style=\"padding-bottom: 10px\">Isn&#8217;t it good?<\/p>\n<p style=\"padding-bottom: 10px\">Well, Git&#8217;s (read about git diff) and Github&#8217;s goodness does not stop just here. Instead of branch names as the values of <strong><em>x<\/em><\/strong> and <strong><em>y<\/em><\/strong>, you can also put two different commit hashes or tag names to view the differences in the code-base. More so, the commit hashes <strong><em>do not<\/em><\/strong> have to belong to the same branch. So you can pretty much compare your code&#8217;s current snap-shot with any of its past snap-shot irrespective of <strong>branch<\/strong> or a <strong>tag<\/strong> or a <strong>commit hash<\/strong>.<\/p>\n<p style=\"padding-bottom: 10px\">Hope this helps someone.<\/p>\n<p style=\"padding-bottom: 10px\">Abhishek Tejpaul<br \/>\nabhishek@intelligrape.com<br \/>\n[IntelliGrape Software Pvt. Ltd.]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Folks, Recently I came across a cool way to compare differences between two branches, two tags, or between two commits on Github. Many a times in our project we have to thoroughly see what has been a specific change in the code base before we push it on our production branch. Here is how [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7},"categories":[1],"tags":[375,584,374],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/3829"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=3829"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/3829\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=3829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=3829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=3829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}