Created
July 4, 2016 17:07
-
-
Save atosatto/c0dd6a3545e0330aa4dc26c6ccef4b9f to your computer and use it in GitHub Desktop.
Change the timestamp of previous Git commits
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
| # Git has two different types of timestamp associated with a commit. | |
| # Although both may typically hold the same value they are used in subtly different ways. | |
| # The author (GIT_AUTHOR_DATE) is the user who originally created the work (i.e. a patch), | |
| # where as the committer (GIT_COMMITTER_DATE) is the user who last applied the | |
| # work (i.e. applied patch or rebase). | |
| git filter-branch --env-filter \ | |
| "if test \$GIT_COMMIT = 'e6dbcffca68e4b51887ef660e2389052193ba4f4' | |
| then | |
| export GIT_AUTHOR_DATE='Sat, 14 Dec 2013 12:40:00 +0000' | |
| export GIT_COMMITTER_DATE='Sat, 14 Dec 2013 12:40:00 +0000' | |
| fi" && rm -fr "$(git rev-parse --git-dir)/refs/original/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment