This is a considerably faster, but much more basic alternative to bash-git-prompt.
Thanks to @michaelneu for inspiration. I modified the script to make it even faster on windows, where subshells are too slow. I also inserted a new line into the prompt as personal preference.