Why does git pull hang?

后端 未结 6 1948
别那么骄傲
别那么骄傲 2020-12-13 14:03

When I do a git pull, from the git bash, the terminal usually runs the pull, updates my local, and then hangs. I\'m not sure if it\'s waiting for me to do somet

相关标签:
6条回答
  • 2020-12-13 14:20

    Check SSH_AUTH_SOCK isn't pointing at a stale ssh-agent endpoint. Unset it (unset SSH_AUTH_SOCK) to test.

    0 讨论(0)
  • 2020-12-13 14:22

    Had same issue, which was related to my ssh client.

    This was confirmed trying to connect to a remote ssh server with the '-v' (verbose) option

    ssh -v -p PORTNUMBER USERNAME@SERVER
    

    which gave rekey after XXXXXX blocks” before getting stuck.

    apt-get purge and apt-get install didn't help, so - before facing the interestign approach here exposed at https://apple.stackexchange.com/a/280800 - I went for an easy reboot, which did the job.

    0 讨论(0)
  • 2020-12-13 14:26

    You may need to remove unnecessary git objects such as dangling commits & blobs:

    git fsck && git gc --prune=now
    

    git-fsck : Verifies the connectivity and validity of the objects in the database
    git-gc : Cleanup unnecessary files and optimize the local repository

    You can refer here about dangling commits & blobs.

    0 讨论(0)
  • 2020-12-13 14:30

    I am in Windows, and I solved the hang by closing the Visual Studio before doing the pull.

    0 讨论(0)
  • 2020-12-13 14:43

    If you are pulling from a linux machine you may want to check this file:

    /etc/ssh/ssh_config

    To make sure you aren't setting your default SSH port to something other than 22. Some people get confused between that file and:

    /etc/ssh/sshd_config

    When they're setting up servers to a non-standard SSH port.

    0 讨论(0)
  • 2020-12-13 14:46

    Your ISP might be blocking the traffic. For example, VirginMedia in the UK does something with a proxy for their filters that causes GitHub traffic to hang. I had this issue, and disabling the filter fixed it.

    0 讨论(0)
提交回复
热议问题