Archived
1
0

Added auto pull if needed

This commit is contained in:
2020-11-25 13:01:29 +00:00
parent 5c7c60d36c
commit 71372250a9

View File

@@ -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
UPSTREAM=${1:-'@{u}'}
@@ -9,9 +11,8 @@ BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
echo "Need to pull"
elif [ $REMOTE = $BASE ]; then
echo "Need to push"
echo "Update available, Pulling form git"
git pull
else
echo "Diverged"
fi