Last active
April 3, 2019 00:46
-
-
Save dlech/6f6c3a74a959d5a0e10ea591e6956c4a to your computer and use it in GitHub Desktop.
git-posh customization
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 | |
# show the git repo name in magenta (really the parent directory name) | |
$GitPromptSettings.DefaultPromptPrefix.Text = '$(@((git rev-parse --show-toplevel).Split("/"))[-1])' | |
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta | |
# show only the relative directory in the git repo | |
$GitPromptSettings.DefaultPromptPath = '\$(@($pwd.Path.Split("\") | Select-Object -Skip @((git rev-parse --show-toplevel).Split("/")).Length) -join "\")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment