Last active
August 29, 2015 14:04
-
-
Save derekgreer/739d7f58b23a026ad532 to your computer and use it in GitHub Desktop.
git-commit-often.bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while (( 1 )) | |
do | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
CHANGES=$(git status --porcelain) | |
if [[ "${CHANGES}" != "" && "${BRANCH}" != "master" ]] | |
then | |
echo "There are changes or untracked files to be committed." | |
DATE=$(date +%Y%m%d-%s) | |
git add --all . | |
git commit -m "${DATE}:squash me!" | |
fi | |
sleep $(( 60 * 5 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment