Created
July 30, 2019 07:15
-
-
Save iverasp/b52c0d8f3bf998314f6e630d0760a035 to your computer and use it in GitHub Desktop.
ZSH git aliases
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 shortcuts | |
| alias gs='git status' | |
| alias gcm='git checkout master' | |
| alias gplom='git pull origin master' | |
| alias gphom='git push origin master' | |
| alias gb='git branch' | |
| alias ga='git add' | |
| alias gc='git commit -m' | |
| alias gp='git pull' | |
| alias go='git checkout' | |
| # lsd | |
| alias ls='lsd' | |
| function gm() { | |
| jiraNumber=$(git branch | grep \* | cut -d ' ' -f2 | grep -Eo "[A-Za-z]*-[0-9]+" | tr a-z A-Z) | |
| commitMessage="$jiraNumber $@" | |
| echo "Comitting with message \"$commitMessage\"" | |
| git commit -m "$commitMessage" | |
| } | |
| function gph() { | |
| branch=$(git branch | grep \* | cut -d ' ' -f2) | |
| echo "Pushing to branch \"$branch\"" | |
| git push origin $branch | |
| } | |
| function gpl() { | |
| branch=$(git branch | grep \* | cut -d ' ' -f2) | |
| echo "Pulling from branch \"$branch\"" | |
| git pull origin $branch | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment