Last active
January 16, 2018 17:11
-
-
Save dkoloditch/1dd7911a4aa907cf4a8ad0a23d64d647 to your computer and use it in GitHub Desktop.
Bash prompt for Docker containers that shows current Git branch
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
# Based on: https://gist.github.com/scmx/242caa249b0ea343e2588adea14479e6 | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1='🐳 \[\033[1;36m\]\h \[\033[1;36m\]\W \[\033[1;34m\]$(parse_git_branch) \[\033[1;34m\]\[\033[1;36m\]# \[\033[0m\]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment