Defjam121
8/23/2017 - 1:23 PM

gitpush script - git add, commit and push, after removing temporary files (see clean script)

gitpush script - git add, commit and push, after removing temporary files (see clean script)

#!/bin/sh
if [ -z "$1" ] 
then
  echo "gitpush script - git add, commit and push (and remove temporary files, if clean script exists)"
  echo "use: gitpush {message}"
  exit 0;
fi

if [ -d "${HOME}/scripts/" ]; then
  if [ -f "${HOME}/scripts/clean" ]; then
    echo "cleaning.."
    ~/scripts/clean -f
  fi
fi

echo "adding.."
git add -A
echo "committing.."
git commit -a -m "$1"
echo "pushing.."
git push origin master