Created
August 1, 2022 20:17
-
-
Save rscircus/51459ff22a80fe16a3a795177d881a0f to your computer and use it in GitHub Desktop.
rework git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git | |
# | |
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment