Last active
October 13, 2015 10:08
-
-
Save ayumi/4180106 to your computer and use it in GitHub Desktop.
bashrc
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=/usr/local/bin:$PATH | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
# Git autocomplete | |
source ~/.git-completion.bash | |
# Git dirty state in prompt | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' | |
# Aliases | |
alias be="bundle exec" | |
alias c="clear" | |
alias ll="ls -la" | |
alias f="foreman" | |
alias fs="foreman start" | |
alias h="heroku" | |
alias go="touch tmp/restart.txt" | |
alias g="git" | |
alias ga="git add" | |
alias gc="git commit" | |
alias gl="git log" | |
alias gd="git diff" | |
alias gco="git checkout" | |
alias gdlist="git diff master --stat" | |
alias gg="git log --graph --pretty=format:'%C(yellow)%h%Creset%C(blue)%d%Creset %C(white bold)%s%Creset %C(white dim)(by %an %ar)%Creset' --all" | |
alias greset="git add . && git stash && git stash drop" | |
alias gs="git status" | |
alias gm="git mergetool -t opendiff" | |
alias gp="git pull" | |
alias gpb="git push bitbucket" | |
alias gph="git push heroku master" | |
alias gf="git fetch" | |
alias gc="git commit" | |
alias gpa="git patch add" | |
alias glist="git for-each-ref --format='[%(authordate:short)] %(refname:short) :: %(subject)' --sort=authordate refs/heads/" | |
alias grmall="git rm $(git ls-files --deleted)" | |
alias sbr="source ~/.bashrc" | |
alias s="screen" | |
alias vbr="vim ~/.bashrc" | |
# stuff | |
alias redisstart="redis-server /usr/local/etc/redis.conf" | |
alias redisstop="killall redis-server" | |
alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start" | |
alias pgstop="echo Stopping postgres; pg_ctl -D /usr/local/var/postgres stop -s -m fast" | |
alias mysqlstart="mysql.server start" | |
alias mysqlstop="mysql.server stop" | |
### Added by the Heroku Toolbelt | |
export PATH="/usr/local/heroku/bin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment