When you're trying to find why a specific change was made, then git blame
is also your friend.

On Mon, Sep 14, 2015 at 7:16 AM, Paul Smith <p...@mad-scientist.net> 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>
>
>
> --
> 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.
>

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