This error:
stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
indicates that Jenkins is trying to connect to github with the wrong ssh key.
You should:
- Determine the user that jenkins runs as, eg. ‘build’ or ‘jenkins’
- Login on the jenkins host that is trying to do the clone – that is, do not login to the master if a node is actually doing the build.
- Try you ssh to github – if it fails, then you need to add the proper key to
<jenkins user home>/.ssh