I case it helps someone else, I wasted quite a lot of time using the bash shell on Windows to build PX4 because the default script
windows_bash_nuttx.sh from here https://dev.px4.io/en/setup/dev_env_windows.html
pulls down the source to ~/src.
This is a bad idea, because typically if you are using Windows it is because you are wanting to use the Windows editing and git tools you are used to, e.g. Visual Code (yes that works on linux as well, but not under the bash shell).
I had used the Windows bash shell for a bit of unix development before without problems so I was surprised at how broken things got when trying to edit/commit files under ~/src, until I read this:
So you should first edit windows_bash_nuttx.sh to remove the lines under # Clone PX4/Firmware.
Then clone PX4 using your favourite Windows gui or Windows command line tool into somewhere NOT under ~, e.g. c:\github\px4
Then access it from the bash shell like: