Add vcs/git/bin/git-old-commit

This commit is contained in:
Henrik Lissner 2017-04-22 22:00:46 -04:00
parent 440114387d
commit 7a76a4498f

11
vcs/git/bin/git-old-commit Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Commits to a local git repository with a timestamp different from when it was
# actually committed. I use this to push old projects with more relevant dates
# (i.e. when they were authored) and to correct clerical mistakes involving lost
# or accidental commits.
#
# Example: git old-commit "-5 years -2 months -11 days -1 hours -19 seconds" "commit message here"
D="$(date --date='-5 years -2 months -11 days -1 hours -19 seconds')"
GIT_COMMITTER_DATE="$D" GIT_AUTHOR_DATE="$D" git commit -m "$2"