好的,所以在 git bash 中这个 cmd..
git log --pretty='%C(yellow)%h%Creset %s' --abbrev-commit
给我一个黄色的提交 ID 和白色的主题行,但是在 powershell 中(使用 posh git)我没有得到黄色的提交 ID(它是默认的白色)。
为什么?
最佳答案
事实证明,PowerShell 的控制台将 System.ConsoleColor.DarkYellow
呈现为白色:
[Enum]::GetValues([ConsoleColor]) | %{ Write-Host $_ -ForegroundColor $_ }
使用 bold yellow
代替,它使用 System.ConsoleColor.Yellow
呈现,有效:
git log --pretty='%C(bold yellow)%h%Creset %s' --abbrev-commit
关于git - 为什么在 powershell 和 posh git 中没有黄色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11515089/