Created
March 4, 2010 03:14
-
-
Save elecnix/321362 to your computer and use it in GitHub Desktop.
check-repo-status
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 | |
# Put this in your crontab to be notified when your repo is dirty or commits needs to be pushed to a remote. | |
# Example crontab: | |
# MAILTO=user@yourdomain | |
# 0 * * * Mon-Fri /path/to/check-repo-status /path/to/repo | |
cd $1 | |
git status | grep 'working directory clean' 2>/dev/null 1>/dev/null || { | |
git status | |
git diff | |
exit | |
} | |
git status | grep 'Your branch is ahead' 2>/dev/null 1>/dev/null && { | |
git status | |
git log origin/master..master | |
exit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment