threads / discuss / 50273

checkout with given mtime

Subject: checkout with given mtime

## tl;dr

One message between Jan 21, 2019 and Jan 21, 2019.

replies: 0people: 1as markdown or json

Daniel Fanjul· Jan 21, 2019, 14:17 UTC · lore
Hi all,

When the mtimes of my tracked files are updated during usual git commands some other tools that depend on them have trouble. So I restore their mtimes for these other tools and then git ends rereading contents of files that have not changed. I would like to improve this.

Is there a way to check out a file with a given mtime so I do not have to update it later and force git to reread it?

Something like 'git checkout --mtime $mymtime -- $myfile'. If the file is not there or does not have the proper contents, git would write the file, set the mtime of the file and update the index accordingly. If the file is there and does have the proper contents according to the index, git would update the mtime of the file, update the index accordingly, and not read or write the contents at all.

Thanks, and regards, Daniel.

← back to recent threads