Added auto pull if needed
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
#Git update checker
|
#Git update checker
|
||||||
|
## Will folow localy checked-out branch
|
||||||
|
## Make sure localy altered files (config,upload folder, etc) are setup in .gitignore
|
||||||
git remote update
|
git remote update
|
||||||
|
|
||||||
UPSTREAM=${1:-'@{u}'}
|
UPSTREAM=${1:-'@{u}'}
|
||||||
@@ -9,9 +11,8 @@ BASE=$(git merge-base @ "$UPSTREAM")
|
|||||||
if [ $LOCAL = $REMOTE ]; then
|
if [ $LOCAL = $REMOTE ]; then
|
||||||
echo "Up-to-date"
|
echo "Up-to-date"
|
||||||
elif [ $LOCAL = $BASE ]; then
|
elif [ $LOCAL = $BASE ]; then
|
||||||
echo "Need to pull"
|
echo "Update available, Pulling form git"
|
||||||
elif [ $REMOTE = $BASE ]; then
|
git pull
|
||||||
echo "Need to push"
|
|
||||||
else
|
else
|
||||||
echo "Diverged"
|
echo "Diverged"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user