Linux Jenkins configuration Git

Source: Internet
Author: User

1. Uninstall the git1.7.1 that comes with CentOS:
Using git–version to view the version of the system, CentOS should have its own version of Git that is 1.7.1

Terminal input:yum remove git

2. Install the required packages

Terminal input:yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc

     Yum Install gcc Perl-extutils-makemaker

3. Download the git2.2.1 and add git to the environment variable

(1) Terminal input:wget https://github. COM/git/git/archive/v2. 2.1. tar.gz

or open input directly in the browser: https://mirrors.edge.kernel.org/pub/software/scm/git/

Select the version you want to download and upload it to the Linux server under the appropriate path

(2) Unzip:tar zxvf v2. 2.1. tar.gz

(3) Terminal input:

CD git-2.7.0
Make Prefix=/usr/local/git All
Make Prefix=/usr/local/git Install

(4) Configuring environment variables

sudo vim/etc/profile

Export path= $PATH:/usr/local/git/bin

Save and exit

(5) Terminal input:source/etc/profile

4.Git Configuration in Jenkins

(1) Click "System Management"

(2) Click "Global Tool Configuration"

(3) Fill in name and path to git executeable (if git plugin is already installed in "plugin management")

If you don't know which path your git is installed on, the terminal executes whereis git

    

(4) Click on the created job, such as the test shown above, click "Configure"

(5) Click "Source Control", select Git, enter Git address, click Add

(6) Type selection: Username with password, input Username and password

(7) Click "Save"

Note: Some deceptive things encountered, no matter how you configure, always error, such as, if encountered this error, then immediately check the Global tool configuration git path is correct, the environment variable is correct, if all correct, or error, click on "Source Management" add, will username with Password, switch to other options, then Cancel, lie down, normal, surprise

Linux Jenkins configuration Git

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.