Skip to content

Instantly share code, notes, and snippets.

@bobbytables
Created April 9, 2012 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbytables/2344380 to your computer and use it in GitHub Desktop.
Save bobbytables/2344380 to your computer and use it in GitHub Desktop.
dotfile
export GIT_EDITOR="subl -w"
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset=`tput sgr0`
c_user=`tput setaf 6`
c_path=`tput setaf 7; tput bold`
c_black=`tput setaf 0`
c_git_clean=`tput setaf 2`
c_git_dirty=`tput setaf 1`
else
c_reset=
c_user=
c_path=
c_git_clean=
c_git_dirty=
fi
git_prompt ()
{
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2; then
git_color="${c_git_clean}"
else
git_color=${c_git_dirty}
fi
echo " [$git_color$git_branch${c_reset}]"
}
PS1='${c_user}\h${c_reset}:${c_path}\w${c_reset}$(git_prompt)\$ '
alias pryr="pry -r ./config/environment -r rails/console/app -r rails/console/helpers"
[alias]
co = checkout
st = status
pom = pull origin master
pum = push origin master
ds = diff --staged
[color]
diff = auto
status = auto
branch = auto
[core]
editor = mate -w
autocrlf = input
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment