Skip to content

Instantly share code, notes, and snippets.

View rbonvall's full-sized avatar

Roberto Bonvallet rbonvall

View GitHub Profile
@rbonvall
rbonvall / git-prompt.sh
Created February 23, 2009 17:39 — forked from henrik/.bashrc
Git prompt
#!/bin/bash
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
DIRTYCHAR="●"
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "$DIRTYCHAR"