Skip to content

Instantly share code, notes, and snippets.

@SyntaxC4
Last active December 30, 2021 09:10
Show Gist options
  • Select an option

  • Save SyntaxC4/7933408 to your computer and use it in GitHub Desktop.

Select an option

Save SyntaxC4/7933408 to your computer and use it in GitHub Desktop.

Revisions

  1. SyntaxC4 revised this gist Dec 12, 2013. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions change-post-git-colors.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    # Changing color settings in Poshgit

    > This set of documentation takes an assumption that Poshgit was installed using Chocolatey, which installs the powershell Modules in a different directory than the expected defaults.
    1. Navigate to the Poshgit Install Directory
    + **[Chocolatey]** C:\tools\Poshgit\dahlbyk-posh-git-9d624ca\
    + **[Local User]** %UserProfile%\Documents\WindowsPowerShell\Modules\Poshgit
  2. SyntaxC4 revised this gist Dec 12, 2013. 1 changed file with 22 additions and 22 deletions.
    44 changes: 22 additions & 22 deletions change-post-git-colors.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    ## Changing color settings in Poshgit
    # Changing color settings in Poshgit

    > This set of documentation takes an assumption that Poshgit was installed using Chocolatey, which installs the powershell Modules in a different directory than the expected defaults.
    1. 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
    + **[Chocolatey]** C:\tools\Poshgit\dahlbyk-posh-git-9d624ca\
    + **[Local User]** %UserProfile%\Documents\WindowsPowerShell\Modules\Poshgit
    + **[System]** %windir%\System32\WindowsPowerShell\Modules\Poshgit

    2. Right-Click on `GitPrompt.ps1` and select **Edit**
    3. Between line *5* and *39* you will find all of the colour settings
    @@ -63,52 +63,52 @@
    </tr>
    <tr>
    <td>DelimForegroundColor</td>
    <td></td>
    <td>The character used to separate untracked changes from tracked changes in the current branch.</td>
    <td>Yellow</td>
    </tr>
    <tr>
    <td>AfterForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the last characted added to the commandline when a `.git` directory is detected</td>
    <td>Yellow</td>
    </tr>
    <tr>
    <td>BranchForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour which identifies your current branch</td>
    <td>Cyan</td>
    </tr>
    <tr>
    <td>BranchAheadForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour which identifies your current branch is ahead of any/all remote repositories</td>
    <td>Green</td>
    </tr>
    <tr>
    <td>BranchBehindForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour which indentifies your current branch is behind any/all remote repositories</td>
    <td>Red</td>
    </tr>
    <tr>
    <td>BranchBehindAndAheadForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour which identifies your current branch is both Ahead and Behind any remote repositories</td>
    <td>Yellow</td>
    </tr>
    <tr>
    <td>BeforeIndexForegroundColor</td>
    <td></td>
    <td></td>
    <td>DarkGreen</td>
    </tr>
    <tr>
    <td>IndexForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour of items which are being tracked in Git's index.</td>
    <td>DarkGreen</td>
    </tr>
    <tr>
    <td>WorkingForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour of items which are in your working directory and untracked by Git</td>
    <td>DarkRed</td>
    </tr>
    <tr>
    <td>UntrackedForegroundColor</td>
    <td></td>
    <td></td>
    <td>This is the colour of the indicator to notify when there are untracked changes</td>
    <td>DarkRed</td>
    </tr>
    </table>
  3. SyntaxC4 created this gist Dec 12, 2013.
    114 changes: 114 additions & 0 deletions change-post-git-colors.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,114 @@
    ## Changing color settings in Poshgit

    > This set of documentation takes an assumption that Poshgit was installed using Chocolatey, which installs the powershell Modules in a different directory than the expected defaults.
    1. 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

    2. Right-Click on `GitPrompt.ps1` and select **Edit**
    3. Between line *5* and *39* you will find all of the colour settings
    <pre>
    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
    </pre>


    4. Here us a description of each of the foreground colours:

    <table>
    <tr>
    <td>Setting Name</td>
    <td>Description</td>
    <td>Default Colour</td>
    </tr>
    <tr>
    <td>BeforeForegroundColor</td>
    <td>The first character added to the commandline when a `.git` directory is detected</td>
    <td>Yellow</td>
    </tr>
    <tr>
    <td>DelimForegroundColor</td>
    <td></td>
    <td>Yellow</td>
    </tr>
    <tr>
    <td>AfterForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>BranchForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>BranchAheadForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>BranchBehindForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>BranchBehindAndAheadForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>BeforeIndexForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>IndexForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>WorkingForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>UntrackedForegroundColor</td>
    <td></td>
    <td></td>
    </tr>
    </table>