An open API service indexing awesome lists of open source software.

https://github.com/raverona/git-branch-color-status

Displays the status of the current directory git branch with symbols and colors
https://github.com/raverona/git-branch-color-status

bash branch color git ps1

Last synced: 6 months ago
JSON representation

Displays the status of the current directory git branch with symbols and colors

Awesome Lists containing this project

README

          

# Git Branch Color Status
version: 1.1.4
status: actively developed

## What is this?

It's a software to inform you the current state of your repository through symbols and colors

## How does it work?

It runs Bash scripts that checks the state of the git repository present on the current directory and displays it through symbols and colors

## Requirements

- [NodeJS](https://nodejs.org) and [NPM](https://www.npmjs.com/)
- [Bash](https://www.gnu.org/software/bash/)

## How to use it?

- Install it by executing `sudo npm install -g git-branch-color-status`
- Configure your PS1 on your .bashrc file like this `PS1+="\$(git-branch-color-status)";`

### Options available

| Option | Description | Type | Number of Arguments | Available Arguments | Default Value | Syntax |
|:--------:|:----------------------------------------------------------------------------:|:-------:|:--------------------:|:----------------------------:|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------|
| Version | displays the current version
number and exit | Boolean | 0 | N/A | false | -v
--version |
| Color | enable colored output | Boolean | 0 | N/A | true | -c
--color |
| No Color | disable colored output | Boolean | 0 | N/A | false | --no-c
--no-color |
| Bracket | specify the type of brackets
displayed surrounding the
branch status | String | 1 | round,
square,
curly | square | -b round
-b "round"
-b=round
-b="round"
--bracket round
--bracket "round"
--bracket=round
--bracket="round" |

### Exemples

| Command | Output |
|:------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| `git-branch-color-status` | ![word "master" colored in green surrounded by square brackets](doc/img/examples/ColoredExample.png "colored branch name surrounded by square brackets") |
| `git-branch-color-status --no-color` | ![word "master" colored in white surrounded by square brackets](doc/img/examples/NoColorExample.png "non-colored branch name surrounded by square brackets") |
| `git-branch-color-status --no-c --bracket=round` | ![word "master" colored in white surrounded by round brackets](doc/img/examples/NoColorRoundBracketExample.png "non-colored branch name surrounded by round brackets") |

## Symbols and Colors available

### Symbols available

| Symbol | Description |
|:------:|:--------------------------------------|
| `>` | There are renamed files being tracked |
| `*` | Your branch is ahead of remote |
| `+` | There are new files being tracked |
| `?` | There are untracked files |
| `x` | There are deleted tracked files |
| `!` | There are modified tracked files |

### Colors available

| Color | Description |
|:------------------------------------------------------------------------:|---------------------------------------|
| ![word "Green" colored in green](doc/img/text/GreenText.png "Green") | Working tree clean, nothing to commit |
| ![word "Yellow" colored in yellow](doc/img/text/YellowText.png "Yellow") | Your branch is ahead of remote branch |
| ![word "Red" colored in red](doc/img/text/RedText.png "Red") | Working tree not clean |

## How to contribute

Fork this project, create a branch, push your changes and make a pull request destined to the master branch