Skip to content

Instantly share code, notes, and snippets.

@semenko
Created August 25, 2015 23:24
Show Gist options
  • Save semenko/dad434a506486117f570 to your computer and use it in GitHub Desktop.
Save semenko/dad434a506486117f570 to your computer and use it in GitHub Desktop.
git status tester
#!/bin/sh
# Author: Nick Semenkovich <[email protected]>
git remote update >/dev/null 2>&1
gitstatus=`git log master..origin/master`
if [ "$gitstatus" ]
then
if tty -s
then
USER_TTY=`tty`
echo "\n\a\t\t@@@ WARNING @@@ - This software is outdated." > $USER_TTY
echo "\n\nThere is an updated version in git with these changes:\n" > $USER_TTY
echo "$gitstatus" > $USER_TTY
echo "\n\n\t\t@@@ Please run: git pull @@@\n" > $USER_TTY
sleep 2
fi
fi
#END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment