#!/bin/bash
clear
if [ -z "$1" ]; then
/bin/echo "Please enter you GIT Folder"
exit 1
else
/bin/echo "Warning: All local code, in $1, on this PC will be wiped out!!!"
/bin/echo "Please type: yes (hit enter), to do a git pull to make your local copy up to date!"
read agree
if [ $agree = yes ]; then
cd "$1"
branch=$(git symbolic-ref --short -q HEAD)
branch=${branch:-HEAD}
/usr/bin/git pull origin $branch
if [ $? -eq 0 ]; then
/bin/echo "Updated..."
read -n 1 -p "Press any key to continue..."
else
/bin/echo "Error!!!!"
read -n 1 -p "Hit a key..."
exit 1
fi
/bin/echo "thanks"
else
/bin/echo "Skipped update..."
read -n 1 -p "Press any key to continue..."
/bin/echo ""
fi
fi
I work with PHP 7.3. Linux OS: Ubuntu 18.04. IDE: Apache NetBeans 10. DB: MySQL.
Tuesday, September 19, 2017
gpull.sh - Do GIT PULL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment