From 2c374249d43f4a18fb6e6912f9a197efe82496ce Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 4 Feb 2020 10:06:33 +0100 Subject: [PATCH] Move git aliases to git stow module --- git/.config/sh/alias.d/git.sh | 55 +++++++++++++++++++++++++++++++++++ sh/.config/sh/alias | 55 ----------------------------------- 2 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 git/.config/sh/alias.d/git.sh diff --git a/git/.config/sh/alias.d/git.sh b/git/.config/sh/alias.d/git.sh new file mode 100644 index 0000000..e8ffecb --- /dev/null +++ b/git/.config/sh/alias.d/git.sh @@ -0,0 +1,55 @@ +# git alias +if exist git; then + alias g='git' + + 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 gi='git ignore' + + 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 gpm='git pushmerge' + + alias grv='git remote -v' + + alias grs='git restore --staged' + alias grs!='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 diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 68bbf82..e38fa3d 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -31,61 +31,6 @@ alias ..="cd .." alias ...="cd ../.." alias ~="cd ~" -# git alias -if exist git; then - alias g='git' - - 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 gi='git ignore' - - 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 gpm='git pushmerge' - - alias grv='git remote -v' - - alias grs='git restore --staged' - alias grs!='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"