Skip to content

Instantly share code, notes, and snippets.

@alojzije
Created November 17, 2014 14:54
Show Gist options
  • Save alojzije/8cd984b3b84eb6464539 to your computer and use it in GitHub Desktop.
Save alojzije/8cd984b3b84eb6464539 to your computer and use it in GitHub Desktop.
Change timestamp (date/time) of old pushed commits
#!/bin/bash
git filter-branch --env-filter \
'if [ "$GIT_COMMIT" = "5c772109e23dce7d45276453de4e7a1a6fab2548" ]
then
export GIT_AUTHOR_DATE="Sun Nov 16 22:00:12 2014 +0100"
export GIT_COMMITTER_DATE="Sun Nov 16 22:01:38 2014 +0100"
elif [ $GIT_COMMIT = "e3f382f901b9201acdbc5f9b5c46e5bb9b0aae02" ]
then
export GIT_AUTHOR_DATE="Sun Nov 16 22:34:21 2014 +0100"
export GIT_COMMITTER_DATE="Sun Nov 16 22:34:55 2014 +0100"
fi'
@alojzije
Copy link
Author

alojzije commented Dec 8, 2014

add, change or remove desired commits
and run bash {path/}gitTimeStampChange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment