This is a considerably faster, but much more basic alternative to bash-git-prompt.
When adding this script to your .bash_profile
or .bashrc
, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).
The script makes the assumption, that a .git
folder only exists when the directory is a git repo. Also, it checks for the english version of the git status
command, so if you're using git in a different locale, make sure to adjust this.
You are absolutely right. I usually run all my stuff and scripts from the root of the projects, and didn't had to worry about, but your addition is very welcome.
Already updated the gist.
Thank you