Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to clone any repo by git:// protocol and get this error.

fatal: protocol error: bad line length character: SSH-

If I'll change protocol to https:// git will clone without errors.This error occurs only in Ubuntu (12.04, 12.10), on Debian or Fedora I can clone repo without any problems.

May be someone had the same problem and can help me, I searched everywhere and didn't find any solution.

share|improve this question

In case this can help someone. I had a similar issue.

My .bashrc on the remote server was printing information such as the contents of /etc/issue. Git would pick up this information and produce the error you have.

I fixed it by commenting out all lines that produced output to terminal in my .bashrc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.