Posh-git: Posh-git not display well in my powershell

Created on 26 May 2020  路  8Comments  路  Source: dahlbyk/posh-git

image

System Details

  • posh-git version/path: 0.7
  • PowerShell version: 5.1.19631.1
  • Git version: 2.18.0.windows.1
  • Operating system name and version: windows 10 2004

Issue Description

As the picture, there is a long blank before ">" and the script, how could I solve this? Thank you!

All 8 comments

I am having a similar problem as @pharazone. Only Posh-Git isn't indicating anything, for me, as far as being in a git repo. However, I am in a git repo as doing a git status shows:

Annotation 2020-06-06 162339

System Details

  • (I don't know how to get the version of posh-git)
  • PowerShell version: 5.1.18362.752
  • Git version: 2.27.0.windows.1
  • Operating system and version: Windows 10 Pro 1909

To get the version of posh-git, run Get-Module. Also, have you imported posh-git?

Thank you for supplying me with the Get-Module command. I've issued both Get-Module posh-git and Get-Module poshgit (since I'm not sure which I should be using). It produces nothing.

I'm guessing I've failed to import posh-git. I'm sorry, I'm enough of a novice to now know how I should import it.

@rfalanga No worries. Once you've imported it, you can run the Add-PoshGitToProfile -AllHosts so that the next time you start PowerShell, posh-git will auomatically get imported.

@rkeithhill thank you very much for your help!

I believe I've imported it. I've just ran Add-PoshGitToProfile -AllHosts, but got this warning:

WARNING: Skipping add of posh-git import to file 'C:\Users\rodf\OneDrive\Documents\WindowsPowerShell\profile.ps1'.
WARNING: posh-git appears to already be imported in one of your profile scripts.
WARNING: If you want to force the add, use the -Force parameter.

What should I do about this?

Thank you again, @rkeithhill, that took care of it.

What should I do about this?

Those warnings were just telling you that your profile already imports posh-git. So you're set.

@pharazone What environment are you running in? Is that the PS Console, PS in Windows Terminal, PS in VSCode Terminal, PS in VSCode PS Integrated Console or something else?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nairby picture nairby  路  6Comments

luigiberrettini picture luigiberrettini  路  6Comments

rfalanga picture rfalanga  路  5Comments

ewgoforth picture ewgoforth  路  8Comments

Patabugen picture Patabugen  路  8Comments