Search code examples
gittimestampgit-revert

git: How do I revert all files where the only change is a modified timestamp?


I have a lots of modified files in a git repo.

I need to prune the ones where there is no change, where only the timestamp has changed. Due to the amount of files it would take me a loong time to do that manually.

Is there some smart way to do that?


Solution

  • A timestamp change alone should not register in a git status.

    That means a git add would only add files with actual changes.

    Maybe the file permissions have changed though.

    This is more likely to be related to an automatic eol conversion (end of line)

    Since Git 2.8, you can quickly check that with:

    git ls-files --eol