Last active
November 1, 2022 11:25
-
-
Save jeernest/9c5e697f4e72401e9ff7f6fd0309d449 to your computer and use it in GitHub Desktop.
setup PS integratino with git, the script is intended to be called from $profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module posh-git | |
$GitPromptSettings.DefaultPromptSuffix = '`n$(''>'' * ($nestedPromptLevel + 1)) ' | |
$GitPromptSettings.DefaultPromptPath.ForegroundColor = 'Orange' | |
# support for large repositories | |
$GitPromptSettings.RepositoriesInWhichToDisableFileStatus = @("C:\Users\jan.elias\github\repo1") | |
function Get-GitBranchName() { git rev-parse --abbrev-ref HEAD } | |
if (Get-Command PAGEANT.EXE -ErrorAction SilentlyContinue) { | |
$env:SSH_PAGEANT_PID = Get-Process PAGEANT -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id | |
if (-not $env:SSH_PAGEANT_PID) { | |
PAGEANT.EXE $home\.ssh\backup\id_rsa.ppk | |
$env:SSH_PAGEANT_PID = Get-Process PAGEANT -ErrorAction Continue | Select-Object -ExpandProperty Id | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment