Skip to content

Instantly share code, notes, and snippets.

@iverasp
Created July 30, 2019 07:15
Show Gist options
  • Select an option

  • Save iverasp/b52c0d8f3bf998314f6e630d0760a035 to your computer and use it in GitHub Desktop.

Select an option

Save iverasp/b52c0d8f3bf998314f6e630d0760a035 to your computer and use it in GitHub Desktop.
ZSH git aliases
# 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