Created
April 6, 2011 10:18
-
-
Save elia/905432 to your computer and use it in GitHub Desktop.
"project-dir:branch-name> " in git repos, "> " everywhere else (both are colored).
This file contains 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
# To include this custom prompt put this file in "~/bin/" and and put the | |
# following lines in "~/.profile". | |
# | |
# # Include Custom prompt | |
# . ~/bin/elia-git-prompt.sh | |
clear=$'\[\e[0m\]' | |
red=$'\[\e[31m\]' | |
green=$'\[\e[32m\]' | |
yellow=$'\[\e[33m\]' | |
blue=$'\[\e[34m\]' | |
purple=$'\[\e[35m\]' | |
cyan=$'\[\e[36m\]' | |
gray=$'\[\e[37m\]' | |
function __git_base_dir { | |
(__gitdir > /dev/null) && cd "$(__gitdir)" && cd .. && basename "$(pwd)" | |
} | |
export PS1="$red\$(__git_base_dir)$green\$(__git_ps1 \":%s\")$yellow>$clear " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment