Cleaned up and merge other Linux snippit repo
Meged https://git.bprieshof.nl/brammp/linux into ./Linux
This commit is contained in:
18
Linux/Scripts/git-UpdateCheck.sh
Normal file
18
Linux/Scripts/git-UpdateCheck.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#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}'}
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse "$UPSTREAM")
|
||||
BASE=$(git merge-base @ "$UPSTREAM")
|
||||
|
||||
if [ $LOCAL = $REMOTE ]; then
|
||||
echo "Up-to-date"
|
||||
elif [ $LOCAL = $BASE ]; then
|
||||
echo "Update available, Pulling form git"
|
||||
git pull
|
||||
else
|
||||
echo "Diverged"
|
||||
fi
|
||||
Reference in New Issue
Block a user