Skip to content

Instantly share code, notes, and snippets.

@kellydavid
Last active March 23, 2017 16:25
Show Gist options
  • Save kellydavid/06e969fa86839f8f03fb866a47c77a1f to your computer and use it in GitHub Desktop.
Save kellydavid/06e969fa86839f8f03fb866a47c77a1f to your computer and use it in GitHub Desktop.
git bash prompt
# This just a few lines to add to a bash '~/.bashrc' configuration. This will add git
# command completion as well as display the current working branch. I like the format
# of the prompt that this produces so I want to document it here. The git completion
# scripts were obtained from https://github.com/git/git/tree/master/contrib/completion
# Set up git bash support
source ~/.git_bash/git-completion.bash
source ~/.git_bash/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\e[0;33m\u@\H\e[m:\e[0;32m\W\e[m\e[0;34m$(__git_ps1 " (%s)")\e[m\$ '
@ramankumar123
Copy link

what is the code about?

@kellydavid
Copy link
Author

@ramankumar123 It's just a few lines for configuration of a bash prompt which will display the current working branch etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment