brew upgradeã§gitãversion 1.7.12ã«ããã
-bash: __git_ps1: command not found
ã¨ãªãã¨ã©ã¼ãåºã¦ã¡ãã£ã¨ããã£ãã®ã§ã¡ã¢ã
â»ã¡ãªã¿ã« MacのターミナルでGitのブランチ名を表示する - アインシュタインの電話番号☎ ãå ã«gitã³ãã³ãã®ã¿ãè£å®ãè²ã¤ãããã¦ãã¾ãã
調ã¹ã¦ã¿ããgit-completion.bashã§__git_ps1ãè¦ã¤ãããªãã¦ã¨ã©ã¼ã«ãªã£ã¦ã模æ§ã
解決çã¨ãã¦ã¯
source /usr/local/etc/bash_completion.d/git-prompt.sh source /usr/local/etc/bash_completion.d/git-completion.bash GIT_PS1_SHOWDIRTYSTATE=true export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
ã®ããã«ãgit-completion.bashã®åã«git-prompt.shãèªã¿ãã¾ããã°OKã§ãã
å ã¨ã³ããªã§ã¯git-completion.bashãæåã§ã³ãã¼ãã¦ããããã§ãããhomebrewã§gitãå ¥ãã¦ãããªãèªåçã«ã¨ã¤ãªã¢ã¹ãè²¼ãããã®ã§ä¸è¦ã§ãã*1
$ ls -l /usr/local/etc/bash_completion.d/ total 16 lrwxr-xr-x 1 sue445 admin 65 8 30 00:16 git-completion.bash -> ../../Cellar/git/1.7.12/etc/bash_completion.d/git-completion.bash lrwxr-xr-x 1 sue445 admin 59 8 30 00:16 git-prompt.sh -> ../../Cellar/git/1.7.12/etc/bash_completion.d/git-prompt.sh
*1:ä»åã®ããã«upgradeã§åæã«åããªããªãã®ã§è«¸åã®å£ã§ããã»ã»ã»