Created
February 25, 2013 11:03
-
-
Save b-murphy/5029140 to your computer and use it in GitHub Desktop.
bash profile.
This file contains hidden or 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
export PATH="/Users/brendanmurphy/bin:$PATH:." | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
alias be="bundle exec" | |
alias rdb="bundle install; bundle exec rake db:drop; bundle exec rake db:create; bundle exec rake db:migrate; bundle exec rake db:test:prepare" | |
alias rdbi="rdb; import_backup; be rake db:migrate; be rake db:test:prepare" | |
# rails | |
alias rs="rails s" | |
#Git | |
alias g="git" | |
alias gb="git branch --color" | |
alias gc="git checkout" | |
alias gcon="git rebase --continue" | |
alias gl="git log --all --graph --color --oneline" | |
# Rspec | |
alias r="bundle exec rspec" | |
# Cucumber | |
alias c="bundle exec cucumber" | |
# kill a function | |
function close () { | |
local x=$1 | |
ps -ef | grep $x | grep -v grep | awk '{print $2}' | xargs kill -9 | |
} | |
###### To display the current branch in the console :-) | |
####################################################################################### | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
# OPTIONAL - if you want to use any of these other colors: | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local WHITE="\[\033[1;37m\]" | |
local LIGHT_GRAY="\[\033[0;37m\]" | |
# END OPTIONAL | |
local DEFAULT="\[\033[0m\]" | |
PS1="\h:\W $GREEN\$(parse_git_branch) $DEFAULT\$" | |
} | |
proml | |
########################################################################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment