【问题标题】:Star * symbol in git prompt on zshzsh 上 git 提示符中的星 * 符号
【发布时间】:2021-07-26 08:22:15
【问题描述】:

终端: iTerm2

Shell: zsh(哦,我的 zsh)

问题:即使分支已更新且未进行任何更改,我在 git 提示符上仍看到星号 *。知道这意味着什么以及如何从 git 提示符中清除它。

【问题讨论】:

  • “git status”显示什么?
  • 这里是输出: ❯ git status On branch develop 你的分支是最新的'origin/develop'。没有什么可提交的,工作树干净
  • iterm2 实际上并不相关:提示设置在其他终端模拟器中有效。

标签: git oh-my-zsh


【解决方案1】:

官方git-prompt.sh script包括:

# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
# unstaged (*) and staged (+) changes will be shown next to the branch
# name.  You can configure this per-repository with the
# bash.showDirtyState variable, which defaults to true once
# GIT_PS1_SHOWDIRTYSTATE is enabled.

如果您使用的是vcs_info instead,请先检查您的~/.zshrc
它可以带有自己的自定义设置,如this gist

例如,如果您隐藏了任何文件,请与 git stash list 联系。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-24
    • 1970-01-01
    • 2015-07-23
    • 2012-10-28
    • 1970-01-01
    • 2010-11-10
    相关资源
    最近更新 更多