check git
This commit is contained in:
parent
67c247cf28
commit
36dd7409b2
1 changed files with 11 additions and 6 deletions
17
check_git.sh
17
check_git.sh
|
@ -1,9 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
if git diff-index --quiet HEAD --; then
|
||||
# no change
|
||||
exit 0
|
||||
git fetch
|
||||
HEADHASH=$(git rev-parse HEAD)
|
||||
UPSTREAMHASH=$(git rev-parse master@{upstream})
|
||||
|
||||
if [ "$HEADHASH" != "$UPSTREAMHASH" ]
|
||||
then
|
||||
echo "remote has changed"
|
||||
exit 0
|
||||
else
|
||||
# change
|
||||
exit 1
|
||||
fi
|
||||
echo "no change"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Reference in a new issue