Skip to content

Instantly share code, notes, and snippets.

@elecnix
Created March 4, 2010 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elecnix/321362 to your computer and use it in GitHub Desktop.
Save elecnix/321362 to your computer and use it in GitHub Desktop.
check-repo-status
#!/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