How to use SSH keys with Jenkins Workflow Plugin

Have a groovy script that’s executed by the Jenkins Worflow Plugin.

As documented, the git step has only basic configuration so far, having only a single url parameter, and it’s suggested to use the general checkout scm step for anything more complex.

  • git gc and git pull locks up machine and never finishes
  • How can I produce horizontal, ascii git history log representations?
  • Github: Merge commits during pull requests
  • How do I sign out of the desktop version of GitHub?
  • View older failed commit messages
  • git creates files ending in ~?
  • With this, it’s possible to pass credentialsId as so:

    checkout scm: [$class: 'MercurialSCM', source: 'ssh://', clean: true, credentialsId: '1234-5678-abcd']

    But how would one get this to work with an SSH key credentials instead?

  • Does Git somehow stores the list of child commits efficiently
  • How do I get the commit id of the head of master in git?
  • Maintaining git branches with different file organization
  • Force a certain version of git on push to remote repo
  • Merge files with different end-of-line character
  • Diff branches in Atlassian Stash
  • One Solution collect form web for “How to use SSH keys with Jenkins Workflow Plugin”

    The same syntax should work for SSH private key credentials.

    By the way as of 1.4 you can pass credentialsId to the simple git step.

    Also if you update the SSH Credentials plugin you can also choose a human-readable ID (when creating a new credentials item).

    Git Baby is a git and github fan, let's start git clone.