Skip to content

Instantly share code, notes, and snippets.

@jeernest
Last active November 1, 2022 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeernest/9c5e697f4e72401e9ff7f6fd0309d449 to your computer and use it in GitHub Desktop.
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
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