Skip to content

Instantly share code, notes, and snippets.

@granth
Created December 15, 2009 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save granth/257393 to your computer and use it in GitHub Desktop.
Save granth/257393 to your computer and use it in GitHub Desktop.
export PATH=$HOME/bin:/usr/local/bin:/usr/local/git/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/X11R6/bin:$PATH
source /usr/local/git/contrib/completion/git-completion.bash
prompt_status() {
local branch=$(__git_ps1 "%s")
if [ -n "$branch" ]; then
if git_dirty; then
echo "⚡"
return
fi
fi
echo "→"
}
git_branch() {
local branch=$(__git_ps1 "%s")
if [ -n "$branch" ]; then
if [[ ! $(git config homedir.repo) ]]; then
echo -n "$branch"
fi
fi
}
git_dirty() {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment