Last active
August 23, 2022 15:36
-
-
Save MaximRouiller/026c90f66da4ab89ca9987ce0da8241e to your computer and use it in GitHub Desktop.
Updates all the files modified date of a local clone of a git repository to reflect their actual last commit date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Synchronously | |
git ls-tree -r --name-only HEAD | foreach { (Get-Item $_).LastWriteTime = [DateTime]::Parse("$(git log -1 --format="%ad" --date=iso8601 -- $_)") } | |
# Asynchronously | |
git ls-tree -r --name-only HEAD | ForEach-Object -Parallel { (Get-Item $_).LastWriteTime = [DateTime]::Parse("$(git log -1 --format="%ad" --date=iso8601 -- $_)") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment