Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timbru31/git-colored-branch-status
Shows the branch name and colors based on the current git branch status
https://github.com/timbru31/git-colored-branch-status
Last synced: 15 days ago
JSON representation
Shows the branch name and colors based on the current git branch status
- Host: GitHub
- URL: https://github.com/timbru31/git-colored-branch-status
- Owner: timbru31
- Created: 2013-12-18T13:20:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-24T08:58:21.000Z (over 10 years ago)
- Last Synced: 2024-10-16T20:15:33.809Z (28 days ago)
- Language: Shell
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
git-colored-branch-status
=========================Shows the branch name and colors based on the current git branch status
* red --> dirty (untracked or modified files)
* green --> clean
* yellow --> semi-dirty, clean branch but unpushed commitsCopied some code from the .bashrc, because login didn't worked.
## Requirements
The unix programm **tput**, usually found at /usr/bin/tput should be installed
## Integration into an existing
Assuming you are using bash and you already have a **.bashrc** or **.bash_profile** in your **HOME**
directory, simply add a line like this this file to integrate it:source './.git-colored-branch-status'
Then add the following line to integrate the git_prompt. It is assumed that you define your PS1
in MY_PS1. Here is just an example:MY_PS1="$NM[$HI\u $SI\w$NM]$IN"
PROMPT_COMMAND='PS1="$MY_PS1$(git_prompt): "'Do not use PS1 in MY_PSI or directly PROMPT_COMMAND because this will result in an totally unexpected
behaviour.To let the changes have effect, you have to source your .bash_profile or .bashrc file:
source .bash_profile
## Color adjustment
See [here](http://www.gilesorr.com/bashprompt/prompts/flex.html)## Credits/based on:
http://vvv.tobiassjosten.net/bash/dynamic-prompt-with-git-and-ansi-colors/http://jeditoolkit.com/2010/09/04/git-status-in-bash-prompt.html