PowerShell 中 Git status 输出文字颜色的修改

在PowerShell中使用Git,遇到一个问题,输出的文字里有暗红色的,实在太难辨认了。今天忍不了,查了一下解决办法,记录如下。

首先是Git的设置:

git config –global color.status.changed “yellow normal bold”
git config –global color.status.untracked “yellow normal bold”
git config –global color.branch.remote “yellow normal bold”

然后对PowerShell的设置:

用命令

$profile

查看需要修改的文件,在文件末尾添加

$global:GitPromptSettings.WorkingForegroundColor    = [ConsoleColor]::Yellow
$global:GitPromptSettings.UntrackedForegroundColor  = [ConsoleColor]::Yellow

我在使用中发现第二行不必要,反而会报错,注释掉即可。

猜你喜欢

转载自www.cnblogs.com/archerC/p/9385215.html