Search code examples
gitgit-logfile-move

git: view log and changes of moved file


I have file in git and want to check it's history: commits when it was changed and what exactly was changed between this commits.

But:

  1. I know that I have renamed the file in the past git history
  2. May be even have moved between directories.

What is the easiest way to check what I want to check?

P.S. I know about this question: git diff on moved file?, but there is not answer what to do if you have a bad memory and don't remember all previous file names.


Solution

  • To check the history of a file even across file moves or renames it's best to use:

    git log --follow FILENAME