1
0
Fork 0

Autocommitted updated scripts from blocky-cafe

main
Marissa Staib 5 years ago
parent 8dbbf06b7f
commit 1771367320
  1. 16
      bash_aliases.sh

@ -58,14 +58,20 @@ function sync_git_only()
{ {
( (
cd "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )" cd "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )"
needs_push=false
if git add . && ! git diff-index --cached --quiet HEAD; then if git add . && ! git diff-index --cached --quiet HEAD; then
git commit -am "Autocommitted updated scripts from ${hostname}" git commit -am "Autocommitted updated scripts from $(hostname)"
needs_push=true
fi fi
git pull --rebase git pull --rebase
if [[ "$needs_push" == "true" ]]; then if ! git diff --exit-code origin/master master; then
git push git log --reverse origin..master
if ! read "OK to push these changes? (Y/N) " confirm; then
confirm = "N"
fi
if [[ "$confirm" != "Y" ]]; then
echo "Not pushing yet."
else
git push
fi
fi fi
) )
} }

Loading…
Cancel
Save