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

Opscomplete powered by makandra brand

Save money by migrating from AWS to our fully managed hosting in Germany.

  • Trusted by over 100 customers
  • Ready to use with Ruby, Node.js, PHP
  • Proactive management by operations experts
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)