Look at the url in .git/config, in my case there were control characters in the protocol portion. These were not made visible when git generated its error message.
When copy/pasting the error message to another place, the control characters might show up: