Re: how to diff versions of a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 03, 2009 at 12:00:51AM -0500, Matt Graham wrote:

> I'm curious if there's a way to diff between 2 arbitrary versions of a file.
> 
> For example, how can I see the diff between tree.c on HEAD and from 3
> edits (of tree.c) ago?

Others have suggested diffing between two arbitrary revisions, and
limiting the diff by path. E.g.:

  git diff HEAD~3 HEAD -- tree.c

which works just fine.  But I find it more intuitive to simply specify
the diff between two blobs (or trees, if you want), like:

  git diff HEAD~3:tree.c HEAD:tree.c

The added bonus is that you can also use this syntax to diff two files
with different names.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux