Skip to content

Instantly share code, notes, and snippets.

@bmcbm
Last active April 4, 2018 12:21
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 bmcbm/b223ebe66f06bf796f40160e85133d9c to your computer and use it in GitHub Desktop.
Save bmcbm/b223ebe66f06bf796f40160e85133d9c to your computer and use it in GitHub Desktop.
# Timestamped, Git enabled Prompt
#!/bin/bash
# Timestamped, Git enabled Prompt
export PS1='\[\e[01;30m\]\t\[\033[01;32m\] \u\[\e[0m\]@\[\e[01;95m\]\h\[\033[00m\]:\[\e[01;34m\]\w\[\e[00m\]`[[ $(git status 2> /dev/null) =~ Changes\ to\ be\ committed: ]] && echo "\[\e[38;5;202m\]" || echo "\[\e[31m\]"``[[ $(git status 2> /dev/null) =~ untracked\ files\ present ]] && echo "\[\e[33m\]"``[[ ! $(git status 2> /dev/null) =~ nothing\ to\ commit,\ working\ .+\ clean ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)")\[\e[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment