Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
prompt [2017/09/01 14:08] – [On Mac] highliting Zbigniew Jedrzejewski-Szmekprompt [2020/02/05 18:27] (current) – external edit 127.0.0.1
Line 7: Line 7:
 <code bash> <code bash>
 for candidate in /usr/share/git-core/contrib/completion/git-prompt.sh /usr/lib/git-core/git-sh-prompt; do for candidate in /usr/share/git-core/contrib/completion/git-prompt.sh /usr/lib/git-core/git-sh-prompt; do
 +    # This path might need to be adjusted ^^^
     ! type __git_ps1 &>/dev/null && [ -e $candidate ] && . $candidate     ! type __git_ps1 &>/dev/null && [ -e $candidate ] && . $candidate
 done done
Line 26: Line 27:
 <code bash> <code bash>
 if [ -f $(brew --prefix)/etc/bash_completion.d/git-prompt.sh ]; then if [ -f $(brew --prefix)/etc/bash_completion.d/git-prompt.sh ]; then
-     . $(brew --prefix)/etc/bash_completion.d/git-prompt.sh+     . $(brew --prefix)/etc/bash_completion.d/git-prompt.sh        # This path might need to be adjusted
 fi fi
  
Line 39: Line 40:
  
 (Works only with the homebrew version of git.) (Works only with the homebrew version of git.)
 +
 +==== Missing ''git-prompt.sh'' ====
 +
 +Under both Linux and Mac, if you cannot find ''git-prompt.sh'', just get the latest version from git git
 +https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh,
 +save it anywhere in the home directory, and put the path to it in the line annotated with "This path might need to be adjusted".