zsh 上 git 提示符中的星号 * 符号

Kru*_*ush 16 git oh-my-zsh

终端: iTerm2

外壳: zsh(哦我的zsh)

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

看图片

Ant*_*ila 23

* 表示您在此存储库中保存了 x 个存储库。因此,就您而言*1,这意味着您在此存储库中存储了 1 个存储。运行以下命令,您将看到该数字与存储的数量匹配:

\n

git stash list

\n

如果*1打扰你,那么你可以使用以下命令删除\xe2\x80\xa0 你的存储:

\n

git stash clear

\n

\xe2\x80\xa0:这将永久删除您的存储,并且您将无法通过正常的安全机制恢复它们\xe2\x80\xa1。

\n

\xe2\x80\xa1:参考 - https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-Recoveringstasentriesthatwerecleareddroppederroneously

\n

  • 花了将近 30 分钟,你真是救星了!太感谢了! (2认同)

Von*_*onC 3

官方的git-prompt.sh 脚本包括:

# 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.
Run Code Online (Sandbox Code Playgroud)

首先检查您是否~/.zshrc正在使用. 它可以有自己的一套定制,就像这个要点一样。vcs_info

例如,检查git stash list您是否隐藏了任何文件。