Want all your commits to have dates within specific schedules, like 9am to 5pm on weekdays
? That's what this tool does for you.
# Setup
git clone https://github.com/conradkleinespel/delay-git-commit.git ~/delay-git-commit
env -C ~/delay-git-commit npm install
ln -s ~/delay-git-commit/index.js /usr/local/bin/dgc
# In a repository for which you want to enforce usage of delay-git-commit
git config core.hooksPath githooks
cp ~/delay-git-commit/githooks/pre-commit githooks/pre-commit
cp ~/delay-git-commit/githooks/pre-push githooks/pre-push
# Set your schedule, using cron strings to define when your commits should be made
# For example, 9am to 5pm on week days
dgc timeslot --add --days "1-5" --start "0900" --end "1700"
# Commit now with a date within a future timeslot of your choice
# Any options from "git commit" will work
dgc commit -m "My commit message"
# Push commits for which the date is in the past to the upstream tracking branch
# Any options from "git push" will work
dgc push