Jenkins hangs at git fetch

This is probably a firewall issue. You can authenticate to Github using SSH (port 22), so that route is working. Your job however is trying to access github via https://github.com (port 443) which timeouts. Try accessing github over ssh by changing the repository url to [email protected]:account/repository.git (you can find this URL on the main page of the repo, dropdown 'Choose a clone URL', option 'SSH'.


I had the same problem as the OP. SSH credentials are stored in Jenkins and work for many other nodes accessing the same repo. I can ssh into the machine as the Jenkins user and do a git clone on the repo using the same SSH repo URL as the Jenkins job ([email protected]:account/repo.git).

As a workaround, I set the git credentials in the Jenkins job to none for now. I assume that allows it to use the credentials stored locally.

It is working now.