Committing existing files to existing Git repository, while preserving timestamps

The situation is this: I have a bunch of files from ages ago (back when I wasn’t using source control of any kind) which I’d love to put to modern-time Git repositories.

I found one tool for this – file-fast-export. It takes existing files and spits out a file that can be fed to git fast-import. Fine so far.

Only problem is that fast-import is a bit picky about input format and file-fast-export isn’t a particularly polished program – it assumes files are being imported into a new repository.

So my use case is this: I have a git repository. I discovered a previously missing subdirectory. File modification times are there. I’d need to commit each of those files on top of the current repository history so that the commit timestamps correspond to the modification times. As I understood it, Git doesn’t force commits to have chronologically consecutive timestamps, only that commits follow one another. I’m happy if I can just do git log xxxxx.txt and see file history.

I’m sure there are tools that can do this. How can I do this?

Git Baby is a git and github fan, let's start git clone.