On Sun, Sep 13, 2015 at 03:16:21PM -0400, Paul Smith wrote:
> On Sun, 2015-09-13 at 11:32 -0700, Michael wrote:
> > I've got a file, with a diff/change, that I thought had already been
> > checked into a previous commit. I want to see if this change exists in
> > any checkin of that file.
> > 
> > Is there any way to ask for "all the checked-in versions of file X"?
> > As far as I know, git only knows files by their sha hashes, and not by
> > names -- which already tells me that there's probably something that I
> > really don't understand about git.
> Git doesn't know files by SHA hashes.  Git knows "a set of changes to
> one or more files" by its SHA hash.  The SHA hash names the _commit_ not
> a specific file.
> However, if you want to see the commits that impacted a given file it's
> trivial:
>   git log <filename>
> If you want to see the commits that impacted any file in a subdirectory
> that's trivial as well:
>   git log <dirname>

For easy viewing of both log and the actual diffs I can recommend the
tool `tig`:

    tig <filename>


Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

Unreadable code,
Why would anyone use it?
Learn a better way.
     -- Geoff Kuenning's contribution to the 2004 Perl Haiku Contest,
        Haikus about Perl - 'Dishonerable Mention' winner

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to