git分支末尾的符号(*+!)是什么意思?

发布于 2025-01-29 08:27:21 字数 382 浏览 2 评论 0原文

有时我注意到我的git分支具有*+的后缀。那可能不是一个详尽的清单,只是我注意到的几个。我认为+意味着分支很脏,表示我应该拉主,但是在任何地方都记录下来吗?这些特殊字符有名字吗?

另外,有时字符不会在VSCODE和ZSH之间同步,这会增加混乱...

“在此处输入图像说明”

I sometimes notice that my git branch has suffixes of ! or * or +. Thats probably not an exhaustive list, just a few I noticed. I think + means the branch is dirty, and ! means I should pull master, but is this documented anywhere? Is there a name for these special characters?

Also, sometimes the characters don't synchronize between vscode and zsh, which adds to the confusion...

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜声 2025-02-05 08:27:21

这是您终端的提示,显示的信息取决于您在该提示中打印GIT信息的扩展名。

! * +字符不是git命令的一部分,它们是由该扩展名添加的,可能是指:当前分支是:

  • 当前分支是最新/最新/前方/落后/相对于其远程分支,
  • 需要在您的存储库中解决主动冲突...

您知道您安装了哪些ZSH扩展名以在您的提示中获得GIT信息?
检查该扩展程序的文档 /手册。


关于“字符不同步vscode和zsh”:提示中显示的消息不是动态的,“刷新”的唯一方法是让您的终端显示一个新提示键入[Enter])。

This is the prompt of your terminal, the information displayed depends on the extension you use to print git information in that prompt.

The ! * + characters are not part of git commands, they are added by that extension, probably to indicate one of :

  • current branch is up to date/ahead/behind/forked with respect to its remote branch,
  • there are active conflicts needing to be resolved in your repo ...

Do you know what zsh extension you installed to have git information in your prompt ?
Check the documentation / manual for that extension.


About the "the characters don't synchronize between vscode and zsh" : the message displayed in the prompt is not dynamic, the only way to "refresh" it is to have your terminal display a new prompt (e.g: click in your terminal and type [enter]).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文