Skip to content

Instantly share code, notes, and snippets.

@m00s
Last active August 29, 2015 14:20
Show Gist options
  • Save m00s/77c012cc8c4a6b16a0c6 to your computer and use it in GitHub Desktop.
Save m00s/77c012cc8c4a6b16a0c6 to your computer and use it in GitHub Desktop.
My OS X bash profile
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source $GITAWAREPROMPT/main.sh
export PS1="\[\033[0;35m\]\u\[\033[1;33m\]: \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# -----------------------------
# 1. IMPROVING THE SHELL
# -----------------------------
alias c='clear'
alias ~='cd ~'
alias ..='cd ../'
alias ...='cd ../../'
alias edit='subl . &'
alias path='echo -e ${PATH//:/\\n}'
alias ls='ls -FGlAhp'
alias profile='vim ~/.bash_profile'
alias reload='source ~/.bash_profile'
alias mac-shutdown='sudo shutdown -h now'
alias mac-restart='sudo shutdown -r now'
# -----------------------------
# 2. USEFUL FUNCTIONS
# -----------------------------
function server(){ python -m SimpleHTTPServer "$1";}
function goo(){ /usr/bin/open -a "/Applications/Google Chrome.app" "http://google.com/search?q=$1 $2 $3 $4 $5";}
# -----------------------------
# 3. GIT COMMANDS
# -----------------------------
alias gis='git status'
alias gil="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gip='git pull'
alias gib='git branch'
alias gid='git diff'
alias git!='git checkout -f'
alias gi.='git add .'
alias gia='git add -A'
alias gica='git commit --amend'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment