Last active
August 29, 2015 14:02
-
-
Save RamonPage/80386439f362013de219 to your computer and use it in GitHub Desktop.
Git Prompt
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
# Colors | |
NO_COLOR="\[\e[0m\]" | |
BLACK="\[\033[0;30m\]" | |
RED="\[\033[0;31m\]" | |
GREEN="\[\033[0;32m\]" | |
YELLOW="\[\033[0;33m\]" | |
BLUE="\[\033[0;34m\]" | |
MAGENTA="\[\033[0;35m\]" | |
CYAN="\[\033[0;36m\]" | |
WHITE="\[\033[0;37m\]" | |
NORMAL="\[\033[0;39m\]" | |
source ~/.git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=true | |
GIT_PS1_SHOWSTASHSTATE=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
GIT_STATUS='$(__git_ps1 "(%s)")' | |
ROOT_COLOR=$YELLOW | |
if [ "$UID" = "0" ]; then | |
# I am root | |
ROOT_COLOR=$RED | |
fi | |
PS1="$ROOT_COLOR($GREEN\u$GREEN:$CYAN\W$ROOT_COLOR$GIT_STATUS)$CYAN\\$ $NORMAL$EOP" | |
# RVM | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
alias rvm_prompt="PS1='\$(~/.rvm/bin/rvm-prompt)$PS1'" | |
# Git | |
alias gst="git status" | |
alias gdf="git diff --color" | |
alias gcm="git commit -m" | |
alias gad="git add" | |
alias grm="git ls-files --deleted | xargs git rm" | |
alias gsh="git push" | |
alias gll="git pull" | |
alias gbase="git rebase -i @{u}" | |
alias gpick="git cherry-pick" | |
alias int="rake integrate" | |
# SmogFarm db tunnel | |
alias tunneldb='ssh -L 3300:localhost:3306 [email protected] -N -f' | |
# Redis | |
alias redis_start="redis-server /usr/local/etc/redis.conf" | |
# Test Cloud | |
alias test_cloud_ssh="cd ~/Projects/Ruby/xamarin/test-cloud-provisioning/chef/vagrant/frontend.dev" | |
alias test_cloud_frontend="cd ~/Projects/Ruby/xamarin/test-cloud-frontend && rvm use ruby-2.0.0-p195@test-cloud-frontend && rvm_prompt" | |
# Virtualbox | |
alias virtualbox_restart="sudo /Library/StartupItems/VirtualBox/VirtualBox restart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment