Git: What to do when "git log" does not show commits that touch a file

Posted Over 12 years ago. Visible to the public.

Let's say you have commits that change a file (and looking at the commit details show you the changes, etc). Now, when you do a git log you see them, but when you say git log that.file these commits don't show up? This is for you.

The reason is that the file got deleted deleted/re-added/renamed (any or all of those).

Instead of ...

git log master -- some.file

... you need to say:

git log --follow master -- some.file

Then your commits will show up.

Note that tig also understands --follow.


Kudos to Julien for pointing this out.

Arne Hartherz
Last edit
About 9 years ago
Arne Hartherz
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2012-01-16 08:00)