Created
February 3, 2015 14:41
-
-
Save dbalabka/f54137309699ba7d8132 to your computer and use it in GitHub Desktop.
GIT advanced support for command promt
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
# Append to ~/.bashrc | |
# Download from https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
source ~/.git-completion.bash | |
# Download from https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
source ~/.git-prompt.sh | |
# Below script is part of http://msysgit.github.io/ | |
# non-printable characters must be enclosed inside \[ and \] | |
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title | |
PS1="$PS1"'\n' # new line | |
PS1="$PS1"'\[\033[32m\]' # change color | |
PS1="$PS1"'\u@\h ' # user@host<space> | |
PS1="$PS1"'\[\033[33m\]' # change color | |
PS1="$PS1"'\w' # current working directory | |
if test -z "$WINELOADERNOEXEC" | |
then | |
PS1="$PS1"'$(__git_ps1)' # bash function | |
fi | |
PS1="$PS1"'\[\033[0m\]' # change color | |
PS1="$PS1"'\n' # new line | |
PS1="$PS1"'$ ' # prompt: always $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment