简体   繁体   中英

git pull / push returns: fatal: protocol error: bad line length character: _

When I run $git push or $git pull dev master , I received this error:

fatal: protocol error: bad line length character: _

I searched and found this solution:

ssh <host> git-receive-pack <path-to-git-repository>

I ran it. Here is the server response:

00..4b29e780 refs/heads/master report- 
status delete-refs side-band-64k quiet ofs-delta agent=git/1.8.3.1
00..4b29e780 refs/remotes/origin/HEAD
00..4b29e780 refs/remotes/origin/master
0000

What does it mean? What is the problem?

Check the output of a ssh git@YourServer

Generally, it is some kind of welcome message (as a Git server should disallow an interactive session).

But if you see any other output before that welcome message, that would explain any Git error when using SSH. As commented, check the resources files for that account do not output any text.

Thanks VonC, you help solve my problem. My error was in origin url. origin was set to

git remote set-url origin http://192.168.1.88:7990/scm/web/t_new.git

Then I always get error, like this:

$ git push -u origin master Uploading LFS objects: 100% (25924/25924), 22 GB | 0 B/s, done Enumerating objects: 114248, done. Counting objects: 100% (114248/114248), done. Compressing objects: 100% (98480/98480), done. fatal: protocol error: bad line length 81925 MiB | 311.97 MiB/s fatal: sha1 file '' write error: Broken pipe error: failed to push some refs to ' http://192.168.1.88:7990/scm/web/t_new.git '

When i change it begin work like charm.

git remote set-url origin ssh://git@192.168.1.88:7999/web/t_new.git

By the way LFS is enabled. Server is Bitbucket.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM