Skip to content

Instantly share code, notes, and snippets.

@prestonp
Last active December 19, 2015 06:29
Show Gist options
  • Save prestonp/5912167 to your computer and use it in GitHub Desktop.
Save prestonp/5912167 to your computer and use it in GitHub Desktop.
My .bash_profile for OSX

PS1 with Current Git Branch

Install git-completion to ~/.git-completion.sh and git-prompt to ~/.git-prompt.sh.

Then set up

~/.bash_profile

# GHI config
export GHI_TOKEN="generated_token_found_in_github_settings"

# Fix psql for mac
export PGHOST=localhost

# Git completion & branch status
source ~/.git-prompt.sh
[[ -s ~/.bashrc ]] && source ~/.bashrc

# Terminal prompt formatting
STARTCOLOR="\e[0;36m";
ENDCOLOR="\e[0m";
export PS1="$STARTCOLOR\d \t \u:\w\$(__git_ps1 ' (%s)') $ENDCOLOR\n\$ "

# custom ls 
alias ls="ls -GpF" 
export CLICOLOR=1 
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

# colored git diffs
alias gd='git diff --color'

Example:

Wed Jul 03 09:51:54 preston:~/projects/allanon (master) 
$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment