Skip to content

Instantly share code, notes, and snippets.

View afgomez's full-sized avatar
♻️

Alejandro Fernández Gómez afgomez

♻️
View GitHub Profile
@afgomez
afgomez / colorize_git_ps1.bash
Created April 7, 2011 21:06
Color current git branch in prompt
# Color the current git branch in prompt
# red -> master branch, take care!
# blue -> just a normal branch
# green -> dev branch
# cyan -> feature branch
# magenta -> fix branch
function __colorize_git_ps1 () {
local branch=$(__git_ps1 "%s")
if [ -n "$branch" ]; then