Skip to content

Instantly share code, notes, and snippets.

@tylerdigital
Created August 20, 2016 17:56
Show Gist options
  • Save tylerdigital/750039b2afeec101ac6c6859618ddffb to your computer and use it in GitHub Desktop.
Save tylerdigital/750039b2afeec101ac6c6859618ddffb to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -z $3 ]]; then
echo "usage $0
type (plugin or theme)
message
directory"
exit;
fi
if [[ $1 != 'plugin' && $1 != 'theme' ]]; then
echo "Type is not plugin or theme! Goodbye!"
exit;
fi
TYPE=$1
MESSAGE=$2
PATH=$3
# BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
git add -A $PATH;
git commit -m "$MESSAGE"
BRANCH=$(cat $BASE_DIR/.git/HEAD)
BRANCH=$(echo ${BRANCH##*/})
git fetch
git merge origin/$BRANCH
git push origin $BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment