1
0
Fork 0

Add more git aliases, and reformat some of the file for easier reading

Aliases that were added:
   - gs: git status
   - gsts, gstp, gstl, gstll: git stash
   - gf: git fetch
   - gd, gdd: git diff
   - gm: git merge
   - gh, ghh, ghhh, ghhhh: git history (pretty)
pull/1/head
Ashley Dev 14 years ago
parent 0874c44407
commit cdf49dd03c

@ -1,32 +1,42 @@
# Aliases # Aliases
alias g='git' alias g='git' ; compdef g=git
compdef g=git alias ga='git add' ; compdef _git ga=git-add
alias gst='git status' alias gaa='git add --all' ; compdef _git gaa=git-add
compdef _git gst=git-status alias gs='git status' ; compdef _git gs=git-status
alias gl='git pull' alias gst='git status' ; compdef _git gst=git-status
compdef _git gl=git-pull # for `gsts "<message>"`
alias gup='git fetch && git rebase' alias gsts='git stash save' ; compdef _git gsts=git-stash
compdef _git gup=git-fetch alias gstp='git stash pop' ; compdef _git gstp=git-stash
alias gp='git push' alias gstl='git stash list' ; compdef _git gstl=git-stash
compdef _git gp=git-push alias gstll='git stash show -p --stat' ; compdef _git gstll=git-stash
gdv() { git-diff -w "$@" | view - } alias gl='git pull' ; compdef _git gl=git-pull
compdef _git gdv=git-diff alias gup='git fetch && git rebase' ; compdef _git gup=git-fetch
alias gc='git commit -v' alias gf='git fetch' ; compdef _git gf=git-fetch
compdef _git gc=git-commit alias gp='git push' ; compdef _git gp=git-push
alias gca='git commit -v -a' alias gd='git diff --no-ext-diff -b' ; compdef _git gd=git-diff
compdef _git gca=git-commit alias gdd='git diff --no-ext-diff' ; compdef _git gdd=git-diff
alias gco='git checkout' gdv() { git-diff -w "$@" | view - } ; compdef _git gdv=git-diff
compdef _git gco=git-checkout alias gc='git commit -v' ; compdef _git gc=git-commit
alias gb='git branch' alias gca='git commit -v -a' ; compdef _git gca=git-commit
compdef _git gb=git-branch alias gco='git checkout' ; compdef _git gco=git-checkout
alias gba='git branch -a' alias gb='git branch' ; compdef _git gb=git-branch
compdef _git gba=git-branch alias gba='git branch -a' ; compdef _git gba=git-branch
alias gcount='git shortlog -sn' alias gcount='git shortlog -sn' ; compdef gcount=git
compdef gcount=git alias gcp='git cherry-pick' ; compdef _git gcp=git-cherry-pick
alias gcp='git cherry-pick' alias gm='git merge' ; compdef _git gm=git-merge
compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5'; compdef _git glg=git-log
alias glg='git log --stat --max-count=5'
compdef _git glg=git-log # Git history (pretty)
local pretty_format_oneline='--pretty=format:"%C(yellow)%h %C(green)%cd %C(cyan)%an %C(bold cyan)%d%C(reset) %s" --date=short'
local pretty_format_medium='--pretty=format:"%C(yellow)commit %H %C(bold cyan)%d%C(reset)
%C(cyan)Author: %an <%ae>%C(reset)
%C(green)Date: %cd%C(reset)
%+s
%+b"'
alias gh="git log --graph $pretty_format_oneline" ; compdef _git gh=git-log
alias ghh="git log --graph $pretty_format_medium" ; compdef _git gh=git-log
alias ghhh="git log --graph --stat $pretty_format_medium" ; compdef _git gh=git-log
alias ghhhh="git log --graph --stat -p --full-diff $pretty_format_medium"; compdef _git gh=git-log
# Git and svn mix # Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'

Loading…
Cancel
Save