Skip to content

Instantly share code, notes, and snippets.

@weeebdev
Last active March 3, 2022 16:28
Show Gist options
  • Save weeebdev/8249f1b33ef35be1dd99c15a5ba86f7e to your computer and use it in GitHub Desktop.
Save weeebdev/8249f1b33ef35be1dd99c15a5ba86f7e to your computer and use it in GitHub Desktop.
Commit files in the past or any date you want. Supports human writable dates like '10 days ago'
#!/bin/bash
if DATE=$(date -d "$1"); then
echo $DATE;
else
exit 0;
fi
GIT_AUTHOR_DATE="$DATE" GIT_COMMITTER_DATE="$DATE" git commit "${@:2}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment