Skip to content

Instantly share code, notes, and snippets.

@fel-cesar
Last active July 20, 2017 18:44
Show Gist options
  • Save fel-cesar/9bc41cfa10a153d343ce324356c0a5b4 to your computer and use it in GitHub Desktop.
Save fel-cesar/9bc41cfa10a153d343ce324356c0a5b4 to your computer and use it in GitHub Desktop.
This gist is for fixing past commits date, be careful because all the subsequent hashes will be also changed. ALWAYS make backup before doing so
git filter-branch --env-filter \
'if [ $GIT_COMMIT = <COMMIT_HASH> ]
then
export GIT_AUTHOR_DATE=“Mon Jun 19 21:20:50 2017 -0300"
export GIT_COMMITTER_DATE="<CHANGE DATE ON THE FORMAT ABOVE>"
fi' -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment