Skip to content

Instantly share code, notes, and snippets.

View ahammar's full-sized avatar

Andreas Hammar ahammar

View GitHub Profile
@ahammar
ahammar / .bashrc
Created January 17, 2015 14:43
Custom Bash prompt showing current Git branch and exit code for failed commands
# put this in your .bashrc
PROMPT_COMMAND=__prompt_command
__prompt_command() {
local LAST_EXIT="$?"
PS1=""
local RED='\[\e[31m\]'
local GREEN='\[\e[01;32m\]'
local BLUE='\[\e[01;34m\]'