Add git aliases

This commit is contained in:
Marty Oehme 2020-02-01 20:09:13 +01:00
parent b40b6d8c74
commit 2f7a484b16
2 changed files with 50 additions and 3 deletions

View file

@ -31,6 +31,56 @@ alias ..="cd .."
alias ...="cd ../.."
alias ~="cd ~"
# git alias
if exist git; then
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gbd='git branch -d'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcb='git checkout -b'
alias gco='git checkout'
alias gd='git diff'
alias gds='git diff --staged'
alias glog='git log --stat'
alias glg='git log --oneline --decorate --graph'
alias glga='git log --oneline --decorate --graph --remotes --all'
alias glgp='git log --stat -p'
alias gf='git fetch'
alias gl='git pull'
alias gpn='git push --dry-run'
alias gp='git push'
alias gpf!='git push --force'
alias grv='git remote -v'
alias grs='git restore --staged'
alias grss='git restore'
alias grbi='git rebase -i'
alias grbc='git rebase --continue'
alias gst='git status'
autoload -Uz is-at-least
if is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')"; then
alias gsta='git stash push'
else
alias gsta='git stash save'
fi
alias gstp='git stash pop'
alias gstl='git stash list'
fi
# clear my screen
alias cl="clear"

View file

@ -56,9 +56,6 @@ load_plugins() {
# set up nvm, the npm version manager
zgen load lukechilds/zsh-nvm
# Add git helper scripts.
zgen oh-my-zsh plugins/git
zgen oh-my-zsh plugins/colored-man-pages
# Load me last