-
Navigate to the Poshgit Install Directory
- [Chocolatey] C:\tools\Poshgit\dahlbyk-posh-git-9d624ca\
- [Local User] %UserProfile%\Documents\WindowsPowerShell\Modules\Poshgit
- [System] %windir%\System32\WindowsPowerShell\Modules\Poshgit
-
Right-Click on
GitPrompt.ps1
and select Edit -
Between line 5 and 39 you will find all of the colour settings
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor BeforeText = ' [' BeforeForegroundColor = [ConsoleColor]::Yellow BeforeBackgroundColor = $Host.UI.RawUI.BackgroundColor DelimText = ' |' DelimForegroundColor = [ConsoleColor]::Yellow DelimBackgroundColor = $Host.UI.RawUI.BackgroundColor AfterText = ']' AfterForegroundColor = [ConsoleColor]::Yellow AfterBackgroundColor = $Host.UI.RawUI.BackgroundColor BranchForegroundColor = [ConsoleColor]::Cyan BranchBackgroundColor = $Host.UI.RawUI.BackgroundColor BranchAheadForegroundColor = [ConsoleColor]::Green BranchAheadBackgroundColor = $Host.UI.RawUI.BackgroundColor BranchBehindForegroundColor = [ConsoleColor]::Red BranchBehindBackgroundColor = $Host.UI.RawUI.BackgroundColor BranchBehindAndAheadForegroundColor = [ConsoleColor]::Yellow BranchBehindAndAheadBackgroundColor = $Host.UI.RawUI.BackgroundColor BeforeIndexText = "" BeforeIndexForegroundColor= [ConsoleColor]::DarkGreen BeforeIndexBackgroundColor= $Host.UI.RawUI.BackgroundColor IndexForegroundColor = [ConsoleColor]::DarkGreen IndexBackgroundColor = $Host.UI.RawUI.BackgroundColor WorkingForegroundColor = [ConsoleColor]::DarkRed WorkingBackgroundColor = $Host.UI.RawUI.BackgroundColor UntrackedText = ' !' UntrackedForegroundColor = [ConsoleColor]::DarkRed UntrackedBackgroundColor = $Host.UI.RawUI.BackgroundColor
-
Here us a description of each of the foreground colours:
Setting Name Description Default Colour BeforeForegroundColor The first character added to the commandline when a `.git` directory is detected Yellow DelimForegroundColor The character used to separate untracked changes from tracked changes in the current branch. Yellow AfterForegroundColor This is the last characted added to the commandline when a `.git` directory is detected Yellow BranchForegroundColor This is the colour which identifies your current branch Cyan BranchAheadForegroundColor This is the colour which identifies your current branch is ahead of any/all remote repositories Green BranchBehindForegroundColor This is the colour which indentifies your current branch is behind any/all remote repositories Red BranchBehindAndAheadForegroundColor This is the colour which identifies your current branch is both Ahead and Behind any remote repositories Yellow BeforeIndexForegroundColor DarkGreen IndexForegroundColor This is the colour of items which are being tracked in Git's index. DarkGreen WorkingForegroundColor This is the colour of items which are in your working directory and untracked by Git DarkRed UntrackedForegroundColor This is the colour of the indicator to notify when there are untracked changes DarkRed
Last active
December 30, 2021 09:10
-
-
Save SyntaxC4/7933408 to your computer and use it in GitHub Desktop.
Changing Colors in Posh-Git
You can edit the posh-git files to achieve this, or you could override the posh-git variable values in your powershell profile script after importing posh-git. This way you don't have to modify posh-git, and you can make your settings into a portable file.
Is it possible to make the git commit hashes in git log --graph --all yellow/gold instead of white ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried that but still see dark red output for not staged and untracked files. That output is unreadable.
