Skip to content

Powershell tools for colorized git commands with icons

License

Notifications You must be signed in to change notification settings

gardebring/PowerColorGit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerColorGit

A Powershell module that improves on the git command line experience with colorized output with icons as well as an easier branch selection experience.

Overview

PowerColorGit is a Powershell module that improves on the git command line experience with simplified and colorized output and simplified branch selection. For the module to work, you must first install Terminal-Icons and setup the Nerd Fonts

The module provides enhancements to the git status git branch and git checkout commands.

For example, this is how the standard output of git status can look like:

git status standard output

With PowerColorGit you instead get this output:

powercolorgit status output

PowerColorGit will also fallback to default behaviour when an option or command is not specifically implemented in PowerColorGit, so you can use commands like PowerColorGit clone, PowerColorGit push or powercolorgit status --short even though nothing is implemented in PowerColorGit for these.

Installation

To install the module from the PowerShell Gallery:

Install-Module -Name PowerColorGit -Repository PSGallery

Example usage

Import-Module PowerColorGit
PowerColorGit status
PowerColorGit branch
PowerColorGit branch -a
PowerColorGit checkout partialbranchname

List the current working tree status

PowerColorGit status

powercolorgit status output

List all remote-tracking and local branches.

In this example, the currently selected branch is feature/add_support_for_branch_picker as indicated with the green color and checkmark.
Please note that the HEAD branch will by default not be displayed in PowerColorGit. You can change this in the configuration.
In this example, the only remotely available branch is main, all others are local only, as indicated with the icons.

PowerColorGit branch -a

powercolorgit branch -a output

Checkout a branch.

With PowerColorGit you can checkout a branch by providing the full or partial name of a branch.
If a single match is found based on the name or partial name you provided, you will be switched to that branch.
If multiple branches were found you will be shown a menu to select which branch you want to switch to.
You can also completely omit giving a branch name. This will show a menu of all branches except the one you are currently on.
The HEAD branch will by default not be displayed in PowerColorGit. You can change this in the configuration.
By default, if there is a remote tracking branch, PowerColorGit checkout will do a git pull after checking out a branch. You can change this setting in the configuration.
In the example below three branches matching the partial branch name feature was found, all of them are local only branches as indicated with the icons:

PowerColorGit checkout feature

powercolorgit branch -a output

Configuration

In the file config.json you will find some configuration options for PowerColorGit.

Alias to pcg

Warning. Do not alias to git since PowerColorGit uses the git command internally and this would cause the module to call itself.

Set-Alias -Name pcg -Value PowerColorGit -Option AllScope

About

Powershell tools for colorized git commands with icons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published