Created
March 9, 2012 17:36
-
-
Save mattscilipoti/2007687 to your computer and use it in GitHub Desktop.
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
alias gst='git status ' | |
alias gc='git commit ' | |
alias gca='git commit -a ' | |
alias ga='git add ' | |
alias gco='git checkout ' | |
alias gb='git branch ' | |
alias gd='git diff ' | |
alias gm='git merge ' | |
alias gmm='git merge master' | |
alias gcom='git checkout master' | |
alias gpom='git push origin master' | |
alias svnpull='git svn rebase' | |
alias svnpush='git svn dcommit' | |
# auto complete bash aliases | |
# see: http://blog.ericgoodwin.com/2008/4/10/auto-completion-with-git | |
complete -o default -o nospace -F _git gb | |
complete -o default -o nospace -F _git gco | |
# hitch | |
hitch() { | |
command hitch "$@" | |
if [[ -s "$HOME/.hitch_export_authors" ]] ; then source "$HOME/.hitch_export_authors" ; fi | |
} | |
alias unhitch='hitch -u' | |
# Uncomment to persist pair info between terminal instances | |
# hitch | |
# git-achievements | |
export PATH="$PATH:/Users/matt/bin/git-achievements" | |
alias git="git-achievements" | |
# Prompt: | |
# see: https://gist.github.com/1419347 | |
function git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'; | |
} | |
function git_status { | |
git diff --quiet HEAD &>/dev/null | |
[[ $? == 1 ]] && tput setaf 1 || tput setaf 2 | |
} | |
# tput + | |
# sgr 0 = default color; | |
# setaf = foreground; setab = background; | |
# 0 = black; 1 = red; 2 = green; 3 = yellow; 4 = blue; 5 = purple; 6 = cyan; 7 = light gray; | |
# prompt becomes red if git working directory has modified files | |
# otherwise it's green | |
## INFO: wrap colors in \[foo\] to fix to line wrap issues. | |
export PS1="\W\[\$(git_status)\]\$(git_branch)\[\$(tput sgr 0)\]$ "; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment