Skip to content

Instantly share code, notes, and snippets.

@ErickAgrazal
Last active July 7, 2023 15:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErickAgrazal/919ffbfe8da8f0362f6aaa62f5165cc0 to your computer and use it in GitHub Desktop.
Save ErickAgrazal/919ffbfe8da8f0362f6aaa62f5165cc0 to your computer and use it in GitHub Desktop.
Use git filter-branch with an env filter that sets GIT_AUTHOR_DATE and GIT_COMMITTER_DATE for the specific hash of the commit you're looking to fix.
git filter-branch --env-filter \
'if [ $GIT_COMMIT = b9230a8b64cbe283744d65b0e372616c0a9ac34c ]
then
export GIT_AUTHOR_DATE="Sat Jan 25 01:38:53 2009 -0500"
export GIT_COMMITTER_DATE="Sat Jan 25 21:01:01 2007 -0500"
fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment