Created
June 16, 2016 16:24
-
-
Save heiglandreas/4b7b84f10b5a3468efb9f448753b0a73 to your computer and use it in GitHub Desktop.
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
# Get the current GIT-Branch-name in brackets | |
function parse_git_branch_and_add_brackets { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/' | |
} | |
# Set the current IP-Address to the variable IP | |
IP=$(route -n get default|grep interface|cut -b 14- | xargs ipconfig getifaddr); | |
# | |
# Set the Prompt to the following: | |
# username@ip-address currentDirectory gitBranchIfExists | |
export PS1="\u@\[\033[1;31m\]$IP\[\033[0m\] \W\[\033[33m\]\$(parse_git_branch_and_add_brackets)\[\033[0m\] \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment