Created
April 5, 2013 21:12
-
-
Save eighteyes/5322660 to your computer and use it in GitHub Desktop.
Mondo Git Bash Aliases & Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show files in log | |
alias glf='git log --oneline --name-only' | |
alias glg='git log --graph --oneline --decorate --all' | |
alias gls='git log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate' | |
# What files were touched x number of times back : glfn 3 | |
alias glfn='git log --oneline --name-only -n' | |
# Open log files x number of times back : glo 1 | |
function __glo(){ | |
subl `git log --name-only -n $1 --format=format: | xargs`; | |
} | |
alias glo='__glo' | |
# Open and grep log files x number of times back : glgo 1 query | |
function __glgo(){ | |
subl `git log --name-only -n $1 --grep '$2' --format=format: | xargs`; | |
} | |
alias glgo='__glgo' | |
# Open staged files | |
function __gso(){ | |
subl `git status -s | cut -c 4- | xargs`; | |
} | |
alias gso='__gso' | |
# Open staged grepped files : gsgo functionName | |
function __gsgo(){ | |
subl `git diff -G '$1' --name-only`; | |
} | |
alias gsgo='__gsgo' | |
# Open grepped files to line : ggo foo | |
function __ggo(){ | |
subl `git grep -n $1 toolkits/ models/ plugins/ | cut -f 1,2 -d ":"` | |
} | |
alias ggo='__ggo' | |
alias gsh='git show' | |
alias gsa='git stash apply' | |
alias ga='git add .' | |
alias gl='git log' | |
alias gs='git status' | |
# No white space changes on diff | |
alias gd='git diff -b' | |
alias gca='git commit -a; git log -n 1 --pretty=%H | tr -d \n | pbcopy;' | |
alias gc+='git commit --amend' | |
alias gb='git branch' | |
alias gc='git checkout' | |
alias gc-='git checkout --' | |
alias gbn='git checkout -b' | |
alias gdl='git diff HEAD^ HEAD' | |
alias gss='git status -s' | |
alias gdel='git branch -D' | |
# Copy working files to clipboard | |
alias gsc='git status -s | cut -c 4- | pbcopy' | |
alias grc='git rebase --continue' | |
alias gcd='git checkout develop' | |
alias gnb='git checkout develop; git checkout -b' | |
# Show diff for last commit | |
alias gld='git log -1 -p' | |
# goto issues | |
alias gi='hub browse -- issues' | |
alias gp='hub browse -- pulls' | |
alias gh='hub browse' | |
# strip lines from clipboard | |
alias pbstrip='pbpaste | tr \\n " " | pbcopy' | |
# paste json format | |
alias pjs="pbpaste | underscore pretty" | |
alias ni='node-inspector' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment