Skip to content

Instantly share code, notes, and snippets.

@hachesilva
Created April 17, 2020 01:18
Show Gist options
  • Save hachesilva/94da03fb7b8d82fdf72b7ec4b5232035 to your computer and use it in GitHub Desktop.
Save hachesilva/94da03fb7b8d82fdf72b7ec4b5232035 to your computer and use it in GitHub Desktop.
Commit to a repo every 60 seconds
#!/bin/bash
# sleep is in seconds, to use minutes, hours, or days append m h or d like so: 10m, 3h, 4d
function commit() {
TIMESTAMP=$(date +%c)
git pull
git add .
git commit -m "Auto update $TIMESTAMP"
git push origin master
}
while true
do
commit
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment