Re: how to diff versions of a file

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

 



On Tue, 3 Feb 2009, Matt Graham wrote:

Hi,
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?

I can do git log and then manually use commit names to do the diff,
but I'm hoping there's a single command that will let me do that.

I don't think it's trivial

If you just wanted three commits ago you could do

git diff HEAD..HEAD^^^ tree.c

but three changes to tree.c ago I think you need to do multiple iterations of git blame to find out what commit was three edits ago.

after you have the commit for three edits ago you do
git diff HEAD..COMMITID tree.c

David Lang
--
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