Modify the prompt string and add $(__git_ps1 " (%s)")
somewhere.
For example, try typing this into Bash:
export PS1="\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]$(__git_ps1 ' (%s)')\n\$"
Once you find something you like, add that line to one of Bash's startup files, e.g. $HOME/.bashrc
.
The source for git-prompt.sh
is well-commented and worth browsing if you're curious about other options.
Note that you may have to manually source path/to/git-prompt.sh
before this will work. If so, add this line to your config file as well, above the export PS1
bit.