Search code examples
gitgithubgit-clone

Error in github? why im i getting this error has been days i cant download the project


This fatal error shows up on github everytime I try to clone the project I tried to download it from the github website but still gets the same error, I have to find a solution because it takes 14-16hrs to download it and as soon is finished I try to open it a lot of files haven't got downloaded.

enter image description here


Solution

  • Please try connecting using ssh instead of using http to clone. Http is more prone for timeouts in case of large repositories.

    Steps to generate SSH: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

    Add the ssh to your github account and your local identity.

    Then use clone command:

    git clone [email protected]:your_org/your_repository.git
    

    If the clone still fails, you can use following approach: Turn off compression:

    git config --global core.compression 0
    

    Start with shallow clone first with depth 1.

    git clone --depth=1 <repo>
    

    Once that is successful, you can incrementally pull more commit histories by

    git fetch --depth=5
    
    git fetch --depth=50
    

    and so on. Finally run following to sync all remaining history.

    git fetch --unshallow