From 71372250a9df9f7b8b93333e918655eb7f145cd6 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 25 Nov 2020 13:01:29 +0000 Subject: [PATCH] Added auto pull if needed --- git-UpdateCheck.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/git-UpdateCheck.sh b/git-UpdateCheck.sh index 85bb74f..f95018f 100644 --- a/git-UpdateCheck.sh +++ b/git-UpdateCheck.sh @@ -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 \ No newline at end of file