Skip to content

Instantly share code, notes, and snippets.

@vasi
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save vasi/ce09e4c285fc146913a5 to your computer and use it in GitHub Desktop.

Select an option

Save vasi/ce09e4c285fc146913a5 to your computer and use it in GitHub Desktop.
#!/bin/sh
dir="$1"
cd "$dir"
# Add new or changed files
git ls-files --exclude-standard -o -m -z | xargs -0r git add
# Commit changes, if any
if ! git diff --cached --quiet; then
git commit --quiet -am "Autocommit at $(date)"
git push --quiet
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment