我将 git 分支添加到我的终端,现在它不断告诉我我在所有目录中的分支主控中。我想也许 git 只是安装在我的 ~ 目录中,所以我跑了
rm -rf .git
但它仍然出现。
这是我添加到我的 .bash_profile 的内容
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "