Last active
March 31, 2021 01:54
-
-
Save st3v/4689877 to your computer and use it in GitHub Desktop.
Manipulate Git Commit Dates
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
# Setting date at commit time: | |
GIT_COMMITTER_DATE="Tue Feb 7 22:47:34 2012 -0800" git commit -m "Ignore stuff" --date "Tue Feb 7 22:47:34 2012 -0800" | |
# Changing date for historical commit: | |
git filter-branch --env-filter 'if [ $GIT_COMMIT = <commit-id> ] | |
then | |
export GIT_AUTHOR_DATE="Tue Feb 7 22:47:34 2012 -0800" | |
export GIT_COMMITTER_DATE="Tue Feb 7 22:47:34 2012 -0800" | |
fi' -f | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment