Skip to content

Instantly share code, notes, and snippets.

@itsamenathan
Last active August 29, 2015 14:08
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 itsamenathan/544dc03bebcb4257fe08 to your computer and use it in GitHub Desktop.
Save itsamenathan/544dc03bebcb4257fe08 to your computer and use it in GitHub Desktop.
Change git commit time
#!/bin/bash
if [ -z "$1" ]; then
echo "Didn't pass in option for date -d"
exit 1
fi
newdate=$(date -d "$1")
export GIT_AUTHOR_DATE=$newdate
export GIT_COMMITTER_DATE=$newdate
git commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment