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.

有帮助吗?

解决方案

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

git log --follow FILENAME
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top