Skip to content

Instantly share code, notes, and snippets.

@peterchaula
Created March 10, 2017 17:11
Show Gist options
  • Save peterchaula/2e18acb8a5d843aa6904febeff4e0d20 to your computer and use it in GitHub Desktop.
Save peterchaula/2e18acb8a5d843aa6904febeff4e0d20 to your computer and use it in GitHub Desktop.
Commit and push in the case of a fire
DATE="`date +%Y-%m-%d_%H_%M`"; \
git add .; \
git commit -m "Save ${DATE}"; \
git push origin HEAD:backup-${DATE}
@peterchaula
Copy link
Author

wget -O /usr/loca/bin/git-backup https://gist.githubusercontent.com/peterchaula/2e18acb8a5d843aa6904febeff4e0d20/raw/1fde8d028b74aefeeb9ea36458fdfdc09ad05585/commit-and-push.sh

chmod +x /usr/local/bin/git-backup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment