Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在我的posh git窗口标题的开头移除积垢?_Git_Powershell_Posh Git - Fatal编程技术网

如何在我的posh git窗口标题的开头移除积垢?

如何在我的posh git窗口标题的开头移除积垢?,git,powershell,posh-git,Git,Powershell,Posh Git,我在powershell窗口中使用posh git,提示非常完美: S:\Repos\DevTools [master ≡ +1 ~2 -0 !]> 但窗口的标题在开头有额外的粗俗: posh~git ~ DevTools [master] 有人知道我如何摆脱多余的posh~git~?它似乎没有必要也没有用处,尽管我可能根本不明白它想告诉我什么。好吧,请你看看!今天刚修好! 谢谢大家 要详细说明接受的答案,有一个自定义选项可供您设置自定义前缀,或者不设置前缀 在您的Powershel

我在powershell窗口中使用posh git,提示非常完美:

S:\Repos\DevTools [master ≡ +1 ~2 -0 !]>
但窗口的标题在开头有额外的粗俗:

posh~git ~ DevTools [master]

有人知道我如何摆脱多余的
posh~git~
?它似乎没有必要也没有用处,尽管我可能根本不明白它想告诉我什么。

好吧,请你看看!今天刚修好!


谢谢大家

要详细说明接受的答案,有一个自定义选项可供您设置自定义前缀,或者不设置前缀

在您的Powershell配置文件中(通过运行
$profile
找到它,在我的例子中,这里就是这个文件:
C:\Users\myuser\Documents\Powershell\Microsoft.Powershell\u profile.ps1
)添加以下内容:

Import-Module posh-git # should already exist if you have posh-git set up
$GitPromptSettings.EnableWindowTitle = $TRUE # or set it to a string if you want a different custom prefix
$GitPromptSettings.AdminTitlePrefixText = "" # optional, remove the prefix when running as admin
重新启动会话,您应该已启动并正在运行