-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bash_prompt
50 lines (46 loc) · 2.21 KB
/
.bash_prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Show GIT branch in prompt
# The argument to __git_ps1 will be displayed only if you
# are currently in a git repository. The %s token will be
# the name of the current branch.
#
# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
# value, unstaged (*) and staged (+) changes will be shown next
# to the branch name. You can configure this per-repository
# with the bash.showDirtyState variable, which defaults to true
# once GIT_PS1_SHOWDIRTYSTATE is enabled.
#
# You can also see if currently something is stashed, by setting
# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
# then a '$' will be shown next to the branch name.
#
# If you would like to see if there're untracked files, then you can
# set GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're
# untracked files, then a '%' will be shown next to the branch name.
#
# If you would like to see the difference between HEAD and its
# upstream, set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates
# you are behind, ">" indicates you are ahead, and "<>"
# indicates you have diverged. You can further control
# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated
# list of values:
# verbose show number of commits ahead/behind (+/-) upstream
# legacy don't use the '--count' option available in recent
# versions of git-rev-list
# git always compare HEAD to @{upstream}
# svn always compare HEAD to your SVN upstream
# By default, __git_ps1 will compare HEAD to your SVN upstream
# if it can find one, or @{upstream} otherwise. Once you have
# set GIT_PS1_SHOWUPSTREAM, you can override it on a
# per-repository basis by setting the bash.showUpstream config
# variable.
GIT_PS1_SHOWDIRTYSTATE=true
#GIT_PS1_SHOWSTASHSTATE=false
#GIT_PS1_SHOWUNTRACKEDFILES=false
GIT_PS1_SHOWUPSTREAM="verbose"
PROMPT_COLOR='1;32m'
CWD_COLOR='1;34m'
if [ ${UID} -eq 0 ]; then
PROMPT_COLOR='1;31m'
fi
export PS1='\[\e[${PROMPT_COLOR}\]\u@\h\[\e[00m\]:\[\e[${CWD_COLOR}\]\w\[\e[31m\]$(__git_ps1)\[\e[00m\]\$ '
export PS2='> '