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