# Default globals for git
git config --global user.name "My name"
git config --global user.email "email@example.com"
git config --global credential.helper 'cache --timeout 360000'
git config --global push.default current
git config --global pull.default current
# If you have multiple GitHub accounts that you use for different repositories
git config --global credential.useHttpPath true

function git() {
    if [[ "$@" == "" ]]; then
    	command git status && command git remote -v && command git show-branch --list
    elif [[ "$@" == "zip" ]]; then
    	command git archive --format=zip HEAD -o $(basename $PWD).zip --verbose
    elif [[ "$@" == "uncommit" ]]; then
    	command git reset --soft HEAD~1
    elif [[ "$@" == "pushall" ]]; then
    	command git push --all origin
    elif [[ "$@" == "pull" ]]; then
    	BRANCH=`command git symbolic-ref --short HEAD`
    	echo Pulling from origin $BRANCH
    	command git pull origin $BRANCH
    elif [[ "$1" == "config" ]]; then
    	command git "$@"
    elif [[ "$@" == "diff" ]]; then
    	command git diff --ignore-space-at-eol -- . ':(exclude)package-lock.json' ':(exclude)yarn-lock.json'
    else
	command git "$@"
    fi
}