Skip to content

Instantly share code, notes, and snippets.

View josnidhin's full-sized avatar

Jose Davis Nidhin josnidhin

View GitHub Profile
@josnidhin
josnidhin / git_prompt.sh
Last active May 30, 2018 06:23
Display the current git branch name in bash
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function git_prompt {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"