top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

+1 vote
1,082 views
How We can get diff between two tags or branches in git?
posted Feb 4, 2016 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn 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.
...