Created
July 9, 2017 12:35
-
-
Save techtonik/341bceb75c551520c0b69184948564ee to your computer and use it in GitHub Desktop.
Commit file versions using their timestamps as commit date
This file contains 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
import os | |
from shellrun import run | |
from datetime import datetime | |
hist = sorted([name for name in os.listdir('.') if name.startswith('appvey') and name != 'appvey.py']) | |
print('\n'.join(hist)) | |
for f in hist: | |
tstamp = datetime.fromtimestamp(os.path.getmtime(f)) | |
run('copy {} appvey.py'.format(f)) | |
run('git add appvey.py') | |
run('git commit -m "hacking.." --date "{}"'.format(tstamp)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment