Skip to content

Instantly share code, notes, and snippets.

@stefanthoss
Created March 21, 2016 21:45
Show Gist options
  • Save stefanthoss/20f41ab97d9ba19cac9b to your computer and use it in GitHub Desktop.
Save stefanthoss/20f41ab97d9ba19cac9b to your computer and use it in GitHub Desktop.
Shell script to automatically commit all new/modified/deleted files in a Git repository. Can be used as a backup tool with cron.
#!/bin/bash
cd /path/to/git/repo/
git add -A
git commit -m "Backup on `date`"
git push origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment