Read more

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

Arne Hartherz
January 16, 2012Software engineer at makandra GmbH

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.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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.

Posted by Arne Hartherz to makandra dev (2012-01-16 09:00)