After trawling google, the bash manpage and other questions here on SO, I have found similar posts but I have failed to determine the cause of this particular issue.
I have installed git-prompt.sh locally. All is good in the bash --login shell. It really is a good thing on both Windows and Linux.
However, as soon as I execute a bash subshell (e.g so that I can temporarily modify my environment etc) I get the error:
$ ... <in/out of repos and all good>
$ bash
bash: __git_ps1: command not found
This problem does not happen on Windows.
Something to note is that I have my dotfiles setup via git. For this reason I can run my configuration on both windows and linux and they both have exactly the same git-prompt.sh file.
Both are fresh OS installs.
My best guess so far is that different shell interaction semantics are executed when operating under windows rather than linux. I have experimented with various bash invocations (--login, --norc ie so I can manually set stuff) etc. There are 3 reasons for this suspicion:
One thing I know for sure is that the first login bash ("sub")shell works perfectly on both platforms.
Any ideas, feedback or pointers?
Thanks,
Matt
Solved. The issue was due to a comibination of (2) above (i.e. indirect different versions of the prompt) and bad quoting of a regular expression by myself in a guard.
Thank you for your help.