Skip to content

Instantly share code, notes, and snippets.

@ItangSanjana
Forked from st3v/commit_dates.sh
Created May 21, 2016 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ItangSanjana/df8cebec817b90faf1bfad528819b816 to your computer and use it in GitHub Desktop.
Save ItangSanjana/df8cebec817b90faf1bfad528819b816 to your computer and use it in GitHub Desktop.
Manipulate Git Commit Dates
# 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