-
-
Notifications
You must be signed in to change notification settings - Fork 823
After installing Git "rc" version, PowerShell reports an error #845
Description
Git version: 2.31.0-rc2 (all rc version)
Operating system version: Windows 10 21H1
PowerShell version: comes with the system
oh-my-posh version: 3.111.2
posh-git version: 1.0.0
Steps to reproduce:
- Run PowerShell as an administrator and run the following command:
Set-ExecutionPolicy RemoteSigned
Install-Module posh-git
Install-Module oh-my-posh
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme PowerLine
- Enter the folder C:\Users\ [your username] \Documents\WindowsPowerShell, edit the text document, and enter the following:
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme PowerLine
And save as Microsoft.PowerShell_profile.ps1
3. Close PowerShell, and open PowerShell again
Expected results:
PowerShell will not report errors
Actual results:
PowerShell reports an error, and the content of the error:
Warning: You appear to have an unsupported Git distribution; setting $GitPromptSettings.AnsiConsole = $false. posh-git recommends Git for Windows.

Remarks:
If you install Git v2.30.2 version, no error will be reported. I installed the 2.31.0 rc1, 2.31.0 rc0, and 2.30.0 rc2 versions, and all encountered this problem. I installed the 2.30.1 and 2.30.2 version again and did not encounter this problem. After I reported this problem in Git, I was told that it was a posh-git problem. Please see: git-for-windows/git#3111 (comment)