From 2f7a484b16d8af9538536907207ee3c320c1440c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 1 Feb 2020 20:09:13 +0100 Subject: [PATCH] Add git aliases --- sh/.config/sh/alias | 50 +++++++++++++++++++++++++++++++++++++ zsh/.config/zsh/plugins.zsh | 3 --- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 9d930f5..a89edb6 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -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" diff --git a/zsh/.config/zsh/plugins.zsh b/zsh/.config/zsh/plugins.zsh index 15bd894..6be2450 100644 --- a/zsh/.config/zsh/plugins.zsh +++ b/zsh/.config/zsh/plugins.zsh @@ -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