Skip to content

Instantly share code, notes, and snippets.

@dkoloditch
Last active January 16, 2018 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkoloditch/1dd7911a4aa907cf4a8ad0a23d64d647 to your computer and use it in GitHub Desktop.
Save dkoloditch/1dd7911a4aa907cf4a8ad0a23d64d647 to your computer and use it in GitHub Desktop.
Bash prompt for Docker containers that shows current Git branch
# 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