Jenkins本机默认使用"yum install -y git" 安装的git版本比较低,应该自行安装更高版本的git。

查看jenkins本机的git版本

1
2
[root@jenkins ~]# git --version
git version 1.7.1

卸载本机低版本的git,自行安装更高版本的git

1
2
3
[root@jenkins ~]# yum remove -y git            //或者使用"rpm -e --nodeps git"命令进行卸载
[root@jenkins ~]# git --version   
-bash/usr/bin/git: No such file or directory

接着进行git版本升级操作:下载并安装高版本的git,下载地址:https://mirrors.edge.kernel.org/pub/software/scm/git/

1
2
3
4
5
6
7
8
[root@jenkins ~]# yum -y install libcurl-devel expat-devel curl-devel  gettext-devel openssl-devel zlib-devel
[root@jenkins ~]# yum -y install  gcc perl-ExtUtils-MakeMaker
[root@jenkins ~]# cd /usr/local/src/
[root@jenkins src]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.1.1.tar.gz
[root@jenkins src]# tar -zvxf git-2.1.1.tar.gz
[root@jenkins src]# cd git-2.1.1
[root@jenkins git-2.1.1]# make prefix=/usr/local/git all
[root@jenkins git-2.1.1]# make prefix=/usr/local/git install

添加git到环境变量

1
2
[root@jenkins git-2.1.1]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
[root@jenkins git-2.1.1]# source /etc/bashrc

查看更新后的git版本和所在路径

1
2
3
4
[root@jenkins ~]# git --version
git version 2.1.1
[root@jenkins ~]# whereis git
git: /usr/local/git

接着登录jenkins界面,依次打开"系统管理" -> "系统设置" -> "Git" -> "Path to Git executable",在此处填入"whereis git"查询出的地址 + "/bin/git" (如上面"whereis git"的地址为"/usr/local/git",则应该填入 "/usr/local/git/bin/git") 并保存。

最后再在Jenkins新建项目中源码管理Repository URL添加git地址,尝试多刷几次就可以了。

jenkens 安装是git版本过低 升级的更多相关文章

  1. docker中Jenkins启动无法安装插件,版本过低

    一.问题现象: 使用docker启动jenkins,在jenkins启动后却无法安装jenkins的插件,一直提示安装失败且从log看到提示信息显示为需要升级jenkins的版本 二.原因分析: 在使 ...

  2. centos下升级git版本的操作记录

    在使用git pull.git push.git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误: error: The requested URL returned e ...

  3. centOS7升级git版本到2.7.3

    CentOS 自带的git版本太低,需要升级到2.1.2版本以上才能使用gitea. 升级方法: 1.安装所需软件包 yum install curl-devel expat-devel gettex ...

  4. 转:centos下升级git版本的操作记录

    https://www.cnblogs.com/kevingrace/p/8252517.html 在使用git pull.git push.git clone的时候,或者在使用jenkins发版的时 ...

  5. Centos7升级Git版本

    centos 升级 Git 版本 问题描述 centos7 系统默认的 git 安装版本是 1.8,但是在项目构建中发现 git 版本过低,于是用源码编译的方式进行升级.同时该文章也适用于安装新的 g ...

  6. centos精简系统 源码安装客户端git

    CentOS的yum源中git版本比较低,需要最新版本git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘. 对于精简型的centos系统,会缺少很多依赖包和插件,要源码安装客户端git, ...

  7. redhat 7.6 安装Python3后配置 yum pip3 升级openssl

    安装python3后需要重新配置yum 配置yum vim /usr/bin/yum #! /usr/bin/python #修改前#! /usr/bin/python2 #修改后 vim /usr/ ...

  8. 手把手告诉你如何安装多个版本的node,妈妈再也不用担心版本高低引发的一系列后遗症(非常详细,非常实用)

    简介 最近好多人都问到node怎么同时安装多个版本? 如何配置node的环境变量,如何自如的在多个版本中切换node?还有就是自己在做appium自动化的时候,有时候会因为node的版本过高或者是太低 ...

  9. 关于IOS新手在安装cocoa pods失败,因为ruby版本过低的解决方法+ (void) {升级ruby}

    http://blog.csdn.net/zhaoen95/article/details/51995520     现在: 使用 OS 系统, 正在学习iOS 需要配置cocoapods 命令行中显 ...

随机推荐

  1. [E2E_L7 51CTO]初步接触OpenVINO提供的例子(win+vs)

    一.例子编译 1.运行 C:\Program Files (x86)\IntelSWTools\openvino_2019.1.148\bin\setupvars.bat 这步需要win平台下安装py ...

  2. Intellij idea 告警:'while' statement cannot complete without throwing an exception

    有时候这个告警是多余的,例如我们手写的监控线程. 如果有消除告警强迫症.在线程的执行方法上加入注解. @SuppressWarnings("InfiniteLoopStatement&quo ...

  3. php中heredoc与nowdoc的使用方法、定界符<<<的使用方法

    一.heredoc结构及用法 Heredoc 结构就象是没有使用双引号的双引号字符串,这就是说在 heredoc 结构中单引号不用被转义.其结构中的变量将被替换,但在 heredoc 结构中含有复杂的 ...

  4. iOS开发应该知道的7个编程概念

    对流行工具(如Xcode)和编程概念(如视图控制器)的高级讨论,这些对iOS开发本身很有用. 1. Xcode Xcode是iOS应用开发社区所见过的最通用的IDE.由于集成开发环境来自Apple,它 ...

  5. LeetCode_405. Convert a Number to Hexadecimal

    405. Convert a Number to Hexadecimal Easy Given an integer, write an algorithm to convert it to hexa ...

  6. jsConfig那些事儿

    jsConfig 是为了解决 vscode 的警告. { "compilerOptions": { "experimentalDecorators": true ...

  7. jQuery fancy box 移除close "X" button

    version: fancybox 2.1.4 <div id="reloadPagePopup" class="div-fancy-box"> & ...

  8. [LeetCode] 254. Factor Combinations 因子组合

    Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a func ...

  9. [LeetCode] 749. Contain Virus 包含病毒

    A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. ...

  10. ATSC/DVB/ISDB三大标准比较

    一.引言  众所周知,模拟电视有NTSC.PAL和SECAM三种标准.目前,数字电视也陷入这种局面,美国.欧洲和日本各自形成三种不同的数字电视标准.美国的标准是ATSC(Advanced Televi ...