Skip to content

Instantly share code, notes, and snippets.

@lejeunerenard
Created October 2, 2013 19:18
Show Gist options
  • Save lejeunerenard/6799088 to your computer and use it in GitHub Desktop.
Save lejeunerenard/6799088 to your computer and use it in GitHub Desktop.
Prompt Environment String for Bash
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\w$(git branch &>/dev/null;\
if [ $? -eq 0 ]; then \
echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \
if [ "$?" -eq "0" ]; then \
# @4 - Clean repository - nothing to commit
echo "⚡"; \
else \
# @5 - Changes to working tree
echo "\[\033[31m\]⚡\[\033[01;00m\]"; \
fi)"; \
else \
# @2 - Prompt when not in GIT repo
echo "⚡"; \
fi) '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment