fatal: early EOF fatal: index-pack failed

后端 未结 30 1583
滥情空心
滥情空心 2020-11-22 10:51

I have googled and found many solutions but none work for me.

I am trying to clone from one machine by connecting to the remote server which is in the LAN network.

30条回答
  •  独厮守ぢ
    2020-11-22 11:36

    It's confusing because Git logs may suggest any connection or ssh authorization errors, eg: ssh_dispatch_run_fatal: Connection to x.x.x.x port yy: message authentication code incorrect, the remote end hung up unexpectedly, early EOF.

    Server-side solution

    Let's optimize git repository on the server side:

    1. Enter to my server's git bare repository.
    2. Call git gc.
    3. Call git repack -A

    Eg:

    ssh admin@my_server_url.com
    sudo su git
    cd /home/git/my_repo_name # where my server's bare repository exists.
    git gc
    git repack -A
    

    Now I am able clone this repository without errors, e.g. on the client side:

    git clone git@my_server_url.com:my_repo_name
    

    The command git gc may be called at the git client side to avoid similar git push problem.


    If you are an administrator of Gitlab service - trigger Housekeeping manually. It calls internally git gc or git repack.


    Client-side solution

    Other (hack, client-side only) solution is downloading last master without history:

    git clone --single-branch --depth=1 git@my_server_url.com:my_repo_name
    

    There is a chance that buffer overflow will not occur.

提交回复
热议问题