Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Created September 12, 2014 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualstaticvoid/f974ab55f68d768d0171 to your computer and use it in GitHub Desktop.
Save virtualstaticvoid/f974ab55f68d768d0171 to your computer and use it in GitHub Desktop.
Git script to quickly add and commit all modified files
#!/bin/bash
comment=${1:-"Autosaved at $(date +%Y)-$(date +%m)-$(date +%d) $(date +%H:%M)"}
# make sure we're at the root of git repo
#if [ ! -d .git ]; then
# echo "Error: must run this script from the root of a git repository"
# exit 1
#fi
echo Autosaving... `pwd`
git add --all
git commit -m "$comment"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment