First, install up Jenkins
Download and install the Jenkins git plugin: git plugin
Create a new Jenkins project and choose to build a free-style software project:
Source management Select Git,repository URL to fill in the Git repository address:
My address is: [Email protected]:/home/repo/test.git format: "username" + "@" + "Git server address" + ":" + "Git repository address"
Credentials there are two ways to configure a git user name and password, and the other is to use a key pair
1, use the user name and password to configure, click Add:
User is a user with Git repository permissions
There is a git user on my git server and ownership of the repository
2, through the SSH key pair way to configure:
The user home directory is first entered on the client
#创建ssh目录 mkdir . SSH -t RSA is the type of the specified secret key Ssh-keygen -t RSA
If the key pair created by the difference is key (private key) and key.pub (public key)
The key is the private key that is copied in the key file, and when set, the public key in Key.pub is copied to the./ssh/authorized_keys file in the user's home directory where the server has permissions to the GIT library.
( note [email protected]:/home/repo/test.git, the git user in front of this address is the user who has been added to the Authorized_keys by the above server )
There are two ways to configure Jenkins to support Git.
To access the GIT repository configuration via Authorized_keys see:
http://blog.csdn.net/lyhdream/article/details/49587657
Jenkins Configure source Control git