5.4.2.1. Installing the plugin
The Git plugin is available in the Jenkins Plugin Manager and is documented on its own wiki page^4.
The plugin assumes that Git (version 1.3.3 or later) has already been installed on your build server, so
you will need to make sure that this is the case. You can do this by running the following command
on your build server:
$ git --version
git version 1.7.1
Next, go back to Jenkins, check the corresponding check box in the Jenkins Plugin Manager page and
click the Install button.
5.4.2.1.1. System-wide configuration of the plugin
After installing the Git plugin, a small new set of configuration options will be available on the Manage
Jenkins#Configure System page (see Figure 5.8, “System-wide configuration of the Git plugin”). In
particular, you need to provide the path to your Git executable. If Git is already installed on the system
path, just put “git” here.
Figure 5.8. System-wide configuration of the Git plugin
5.4.2.1.2. SSH key setup
If the Git repository you are accessing uses SSH passphrase-less authentication—for example, if the
access address is similar to [email protected]:matthewmccullough/some-repo.git—you’ll need
to provide the private half of the key as file ~/.ssh/id_rsa where ~ is the home directory of the user
account under which Jenkins is running.
The fingerprint of the remote server will additionally need to be placed in ~/.ssh/known_hosts to
prevent Jenkins from invisibly prompting for authorization to access this Git server for the first time.
Alternatively, if logging-in is enabled for the jenkins user, SSH into the Jenkins machine as jenkins
and manually attempt to Git clone a remote repository. This will test your private key setup and establish
the known_hosts file in the ~/.ssh directory. This is probably the simplest option for users unfamiliar
with the intricacies of SSH configuration.