23

I've created a repository in my local machine and asked a colleague to clone it, but it's saying it can't handle the SSH protocol. In my computer the repository is at /devel/scripts.git, and there's an user called devel with access to that folder. Another guy could clone it normally, using git clone ssh://devel@192.168.0.7/devel/scripts.git.

We are all using Ubuntu, me and the problematic machine are at 12.04 (I could push from another folder using the same URL as remote) and the other guy is using 13.04.

Finally, the machine that got the issue can access that user via SSH normally.

igorsantos07
  • 4,456
  • 5
  • 43
  • 62

4 Answers4

59

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:

enter image description here

Simon A. Eugster
  • 4,114
  • 4
  • 36
  • 31
wytten
  • 2,800
  • 1
  • 21
  • 38
  • 9
    Based of this idea I retyped the entire git clone command manually instead of copy-pasting it, probably removing some control characters – spoorcc Jan 17 '17 at 08:13
  • It's usually enough to simply cancel and retype the "clone ssh" part (as the control character is usually before ssh) – Enoon Mar 02 '21 at 11:50
18

I faced the same issue on Windows in Cygwin and was able to get around the error by changing the protocol to 'git+ssh'.

git clone git+ssh://devel@192.168.0.7/devel/scripts.git
digitil
  • 879
  • 5
  • 11
4

A way around this is explicitly mentioning the address by using quotes. Instead of using: git clone ssh://devel@192.168.0.7/devel/scripts.git

Try: git clone 'ssh://devel@192.168.0.7/devel/scripts.git'

-1

I had similar issue when trying from windows Git GUI. I executed the command via Git Bash and it worked for me without this error.

Rijo
  • 2,568
  • 1
  • 22
  • 30