如何在 git checkout
的输出中为分支名称(下面以粗体显示)着色?
(base) dollaween $ git checkout develop Switched to branch 'develop'
最佳答案
不同命令的颜色设置由配置变量控制
color.<command>.<slot>
您可以使用命令 git help -c
查看所有可用的配置变量(参见 git config: list all variables and their default values )。如果没有名为 color.checkout....
的变量,那么我认为这是不可能的。
我能想到的最接近的替代方法是在 git status
的输出中为分支名称着色。
例如:
$ git config color.status.branch red $ git status On branch master Your branch is up to date with 'origin/master'. […]
粗体部分现在变成红色。
关于git - 如何在 "git checkout"的输出中着色分支名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65252011/