check git

pull/1/head
Yax 4 years ago
parent 67c247cf28
commit 36dd7409b2

@ -1,9 +1,14 @@
#!/bin/bash
if git diff-index --quiet HEAD --; then
# no change
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
echo "no change"
exit 1
fi
Loading…
Cancel
Save