LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-utimes

Restore file timestamps from commit history

TLDR

Restore file timestamps
$ git utimes
copy

SYNOPSIS

git utimes

DESCRIPTION

git utimes sets each tracked file's mtime to the timestamp of the last commit that modified it. Git intentionally stores no timestamps in the index — every checkout writes files with the time of the operation — and this command reverses that for tooling that depends on file dates (Make, find, sitemap generators, archive tools).The command walks all tracked paths in the working tree and runs touch -t with the matching commit time, so subsequent make-style "modified since" comparisons match the commit history rather than the moment the repo was cloned.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Part of git-extras. Affects only tracked files; ignored and untracked paths keep their current mtime. Will invalidate any incremental build cache that fingerprints by mtime — re-run after each rebuild rather than once per workday. Submodule contents are not touched.

HISTORY

git utimes is part of git-extras, addressing the common issue that git doesn't preserve file modification times.

SEE ALSO

touch(1), git-log(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid