Created
February 28, 2018 06:42
-
-
Save tknerr/158edbe2d3c49a1bb20c44c4b1d766ff to your computer and use it in GitHub Desktop.
A Git Bash Prompt for Ubuntu 16.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PS1='`if [ $? = 0 ]; then echo "\[\e[32m\] ✔ "; else echo "\[\e[31m\] ✘ "; fi`\[\e[00;37m\]\u\[\e[01;30m\]@\[\e[00;37m\]\h\[\e[01;37m\]:\[\e[01;34m\]\w\[\e[00;34m\] `[[ $(git status 2> /dev/null | head -n3 | tail -n1) != "Changes to be committed:" ]] && echo "\[\e[01;31m\]" || echo "\[\e[01;33m\]"``[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] || echo "\[\e[01;32m\]"`$(__git_ps1 "(%s)")`echo "\[\e[00m\]"`\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment