Skip to content

Instantly share code, notes, and snippets.

@fel-cesar
Last active October 12, 2018 21:28
Show Gist options
  • Save fel-cesar/d4ac254a2175841e4a0b3cfebc22a352 to your computer and use it in GitHub Desktop.
Save fel-cesar/d4ac254a2175841e4a0b3cfebc22a352 to your computer and use it in GitHub Desktop.
This snippet is meant to ovewrite the author and committer date locally . BEFORE PUSHED!!!!!! Remember to change the <COMMIT_HASH> adn the <NEW_DATE> according to the defined format. It is advised to backup your repository locally before using the sc
#DATE FORMAT - e.g. 'Mon Jun 19 21:20:50 2017 -0300'
git filter-branch --env-filter \
'if [ $GIT_COMMIT = <COMMIT_HASH> ]
then
export GIT_AUTHOR_DATE=“<NEW_DATE>"
export GIT_COMMITTER_DATE="<NEW_DATE>"
fi' -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment