Skip to content

Instantly share code, notes, and snippets.

View BlackFlame33's full-sized avatar
🎓
Learning Java

BlackFlame33 BlackFlame33

🎓
Learning Java
View GitHub Profile
@wafer-li
wafer-li / git_reset_mtime.py
Last active July 31, 2021 10:30
Restore file last modified time in a newly clone repo.Which base on the file's last commited time. Tested with python 3.4 and above
# -*- coding: utf-8 -*-
import subprocess
import os
import shlex
if __name__ != '__main__':
raise ImportError("%s should not be used as a module." % __name__)
# 'git ls-files -z | xargs -0 -n1 -I{} -- git log -1 --format="%ct {}" {} | sort'