Skip to content

A simple python script to indicate current git branch and status in bash prompt

Notifications You must be signed in to change notification settings

richardbann/gitprompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitprompt

A simple python script to indicate current git branch and status in bash prompt.

Install

Clone this repo somewhere on your machine:

cd [somedir]
git clone https://github.com/richardbann/gitprompt.git

Now append this code to your .bashrc:

set_bash_prompt(){
    PS1="$(python [somedir]/gitprompt/prompt.py)"
}

PROMPT_COMMAND=set_bash_prompt

Be careful to change somedir above according to where you have cloned the repo.

Disclaimer

The script assumes 256 color terminal, so modification to color codes may be needed. Find additional help on terminal coloring: http://misc.flogisoft.com/bash/tip_colors_and_formatting

You can see experiment with foreground and background colors by running 256-colors.sh from the site above.

About

A simple python script to indicate current git branch and status in bash prompt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published