mac M2下git当前分支不显示解决方案
/.zshrc里面补充 source /etc/profile即可。
·
/etc/profile
里面补充内容:
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/(\1)/p'
}
setopt PROMPT_SUBST
export PROMPT='%F{grey}%n%f@%m ~ %F{green}$(parse_git_branch)%f %F{normal}#%f '
~/.zshrc里面补充 source /etc/profile即可。
或者直接在.zshrc里面填写即可;最后 source .zshrc使配置生效!
补充:
安装了.oh_my_zsh但是目录下面为空;解决办法
删除.oh_my_zsh目录,重新安装问题解决
macboorpro M2芯片,安装步骤
git clone https://github.com/robbyrussell/oh-my-zsh.git
cd oh-my-zsh/tools
sh install.sh
更多推荐
已为社区贡献1条内容
所有评论(0)