(Mac) -bash: __git_ps1: command not found

后端 未结 19 1934
感动是毒
感动是毒 2020-11-30 16:20

I\'m trying to change my command promt in terminal. I keep getting the error:

-bash: __git_ps1: command not found

I\'ve tried it just by typing

19条回答
  •  醉梦人生
    2020-11-30 17:07

    Please not that, if you haven't installed git through Xcode or home-brew, you'll likely find the bash scripts haysclarks refers to in /Library/Developer/CommandLineTools/, and not in /Applications/Xcode.app/Contents/Developer/, thus making the lines to include within .bashrc the following:

    if [ -f /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash ]; then
        . /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
    fi
    
    source /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh
    

    You'll need those lines if you wish to use git-prompt as well. [1]: https://stackoverflow.com/a/20211241/4795986

提交回复
热议问题