Last active
December 14, 2015 09:50
-
-
Save superjer/5068108 to your computer and use it in GitHub Desktop.
Bash prompt with Git branch name & colors. It won't have much effect unless your system has the bash completion rules for Git installed. Add this to the end of your .bashrc file in your Home folder on whatever server you are working on. For it to take effect, you will have to log in again, or just run your .bashrc file.
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
GITBRANCH='' | |
if [ -f /etc/bash_completion.d/git ]; then | |
. /etc/bash_completion.d/git | |
GITBRANCH='$(__git_ps1)'; | |
fi | |
# You can change the colors to what you want, especially if you have a 256 color terminal. | |
# Here's a color chart: http://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg | |
# Change the numbers in this column | | |
# | | |
# v | |
GOLDCOLOR='$(tput sgr0 && tput setaf 3)' | |
CYANCOLOR='$(tput sgr0 && tput setaf 6)' | |
RESETTTY='$(tput sgr0)' | |
PS1="\[$GOLDCOLOR\][\u@\h \W]\[$CYANCOLOR\]$GITBRANCH\[$GOLDCOLOR\]\$ \[$RESETTTY\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment