Skip to content

After installing Git "rc" version, PowerShell reports an error #845

@DustinWin

Description

@DustinWin

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:

  1. 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
  1. 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.
111055583-49ac3600-84b2-11eb-879b-b244d468566f
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions