Beautiful and sexy bash prompt with colors, git statuses, and git branches.
Pull request Compare This branch is 357 commits behind twolfson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

sexy-bash-prompt Donate on Gittip

Beautiful and sexy bash prompt with colors, git statuses, and git branches.

Providing a unique symbol for every combination of a dirty, unpulled, and unpushed git branch.

sexy-bash-prompt screenshot

Forked from a gist by gf3.


One line install:

(cd /tmp && git clone --depth 1 && cd sexy-bash-prompt && make install) && source ~/.bashrc

Manual install:

$ # Clone the repository
$ git clone --depth 1
Cloning into 'sexy-bash-prompt'...
Resolving deltas: 100% (13/13), done.
$ # Go into the directory
$ cd sexy-bash-prompt
$ # Install the script
$ make install
# Copying .bash_prompt to ~/.bash_prompt
cp --force .bash_prompt ~/.bash_prompt
# Adding ~/.bash_prompt to ~/.bashrc
echo ". ~/.bash_prompt" >> ~/.bashrc
# twolfson/sexy-bash-prompt installation complete!
$ # Rerun your ~/.bashrc
$ source ~/.bashrc
todd at Euclid in ~/github/sexy-bash-prompt on master
$ # Your PS1 should now look like this!

How does it work?

bash provides a special set of variables for your prompts. PS1 is the one used by default. The install script adds a command to ~/.bashrc, a file that is run every time a new terminal opens. Inside of the new command, we run our script and set your PS1 which runs some git commands to determine its current state and outputs them as a string.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via make test.


Copyright (c) 2013 Todd Wolfson

Licensed under the MIT license.