Skip to content

Instantly share code, notes, and snippets.

@burpnoes
Last active November 21, 2019 07:35
Show Gist options
  • Save burpnoes/9116314 to your computer and use it in GitHub Desktop.
Save burpnoes/9116314 to your computer and use it in GitHub Desktop.
Bash Git Prompt and Completion integration for MacOS (bash completion required)
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS="yes"
GIT_PS1_SHOWDIRTYSTATE=true
export PROMPT_COMMAND='__git_ps1 "\u@\h:\W" "\\\$ ";'
@burpnoes
Copy link
Author

burpnoes commented Mar 11, 2015

@burpnoes
Copy link
Author

burpnoes commented Nov 21, 2019

Bash Git Prompt and Completion integration for Mac OS X Mavericks (Xcode required)

if [ -f /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash ]; then
  . /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
fi

source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh

GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS="yes"

export PROMPT_COMMAND='__git_ps1 "\u@\h:\W" "\\\$ ";'

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