top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How We can get diff between two tags or branches in git?

+1 vote
121 views
posted Feb 4, 2016 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote
 
Best answer
$ git diff tag1 tag2

or show log between them:

$ git log tag1..tag2

sometimes it may be convenient to see only the list of files that were changed:

$ git diff tag1 tag2 --stat

and then look at the differences for some particular file:

$ git diff tag1 tag2 -- some/file/name

A tag is only a reference to the latest commit 'on that tag', so that you are doing a diff on the commits between them.

answer Feb 4, 2016 by Manikandan J
Thanks for answering, How we can git diff of all files between two branches
compare files from two different branches:

git diff can show you the difference between two commits:

git diff mybranch master -- myfile.cs
The same arguments can be passed to git difftool if you have one configured.
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
...