Skip to content

Instantly share code, notes, and snippets.

@ethnt
Created July 19, 2013 16:22
Show Gist options
  • Save ethnt/6040456 to your computer and use it in GitHub Desktop.
Save ethnt/6040456 to your computer and use it in GitHub Desktop.
OS X bash profile. These are the very basics, without much configuration.
###
### .bash_profile
###
export PATH=/usr/local/bin:$PATH
# Get the aliases
source /Users/ethan/.bash_aliases
# Enable colors on the command line
export CLICOLORS=1
# Add ~/.bin to $PATH
export PATH=$PATH:/Users/ethan/.bin
# Set TTY.
if `tty -s`; then
mesg n
fi
# Colored CLI prompt
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;36m\]"
WHITE="\[\033[0;37m\]"
export PS1="$GREEN\h:$BLUE\W$WHITE\$(parse_git_branch)\$ "
# Git helpers
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]/"
}
# Git completion
source /usr/local/git-completion.bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment