CentOS7 安装最新版Git(源码安装)

GIT安装教程(入门) 安装好之后,打开然后使用命令创建你的Git项目上面已经附上习题了,大家可以跟着习题一步一步走一遍! 阅读详情

1、下载最新版Git

a)查看最新版

https://mirrors.edge.kernel.org/pub/software/scm/git/
或者
https://github.com/git/git/releases

b)下载最新版

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.19.1.tar.gz

或在本地下载完成后上传到CentOS虚拟机(建议迅雷下载,wget有点慢)

2、解压

[root@localhost download]# pwd
/usr/local/src/download
[root@localhost download]# ll
total 49276
-rw-r--r--. 1 root root    35676 Oct  4 13:34 container-selinux-2.68-1.el7.noarch.rpm
-rw-r--r--. 1 root root 42712724 Oct  4 13:26 docker-ce-18.06.1.ce-3.el7.x86_64.rpm
-rw-r--r--. 1 root root  7708143 Dec  1 10:02 git-2.19.1.tar.gz
[root@localhost src]# tar -zxvf /usr/local/src/download/git-2.19.1.tar.gz -C /usr/local/src/
[root@localhost src]# pwd
/usr/local/src
[root@localhost src]# ll
total 16
drwxr-xr-x.  3 root root    19 Oct 27 22:23 config
drwxr-xr-x.  2 root root   123 Dec  1 10:03 download
drwxrwxr-x. 25 root root 12288 Sep 28 04:46 git-2.19.1
drwxr-xr-x.  2 root root     6 Nov 30 21:52 workspace

3、编译

a)卸载旧版本

[root@localhost git-2.19.1]# yum remove git

b)make configure出错

[root@localhost git-2.19.1]# make configure
GIT_VERSION = 2.19.1
    GEN configure
/bin/sh: autoconf: command not found
make: *** [configure] Error 127

解决

[root@localhost git-2.19.1]# yum install  autoconf automake libtool
[root@localhost git-2.19.1]# make configure                        
    GEN configure

c)yum install libcurl-devel

[root@localhost git-2.19.1]# yum install libcurl-devel

d)./configure

[root@localhost git-2.19.1]# ./configure --prefix=/usr/local/git --with-iconv --with-curl --with-expat=/usr/local/lib
configure: Setting lib to 'lib' (the default)
configure: Will try -pthread then -lpthread to enable POSIX Threads.
configure: CHECKS for site configuration
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
configure: Setting EXPATDIR to /usr/local/lib
configure: CHECKS for programs
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for inline... inline
checking if linker supports -R... no
checking if linker supports -Wl,-rpath,... yes
checking for gar... no
checking for ar... ar
checking for gtar... gtar
checking for gnudiff... no
checking for gdiff... no
checking for diff... diff
checking for asciidoc... no
Using 'grep -a' for sane_grep
configure: CHECKS for libraries
checking for SHA1_Init in -lcrypto... no
checking for SHA1_Init in -lssl... no
checking for curl_global_init in -lcurl... yes
checking for curl-config... curl-config
checking for XML_ParserCreate in -lexpat... no
checking for iconv in -lc... yes
checking for deflateBound in -lz... no
checking for socket in -lc... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for hstrerror... yes
checking for basename in -lc... yes
checking for gettext in -lc... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
configure: CHECKS for header files
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for inttypes.h... (cached) yes
checking for old iconv()... no
configure: CHECKS for typedefs, structures, and compiler characteristics
checking for socklen_t... yes
checking for struct itimerval... yes
checking for struct stat.st_mtimespec.tv_nsec... no
checking for struct stat.st_mtim.tv_nsec... yes
checking for struct dirent.d_type... yes
checking for struct passwd.pw_gecos... yes
checking for struct sockaddr_storage... yes
checking for struct addrinfo... yes
checking for getaddrinfo... yes
checking for library containing getaddrinfo... none required
checking whether the platform regex supports REG_STARTEND... yes
checking whether system succeeds to read fopen'ed directory... yes
checking whether snprintf() and/or vsnprintf() return bogus value... no
checking whether the platform uses typical file type bits... yes
configure: CHECKS for library functions
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking libcharset.h usability... no
checking libcharset.h presence... no
checking for libcharset.h... no
checking for strings.h... (cached) yes
checking for locale_charset in -liconv... no
checking for locale_charset in -lcharset... no
checking for clock_gettime... yes
checking for library containing clock_gettime... none required
checking for CLOCK_MONOTONIC... yes
checking for setitimer... yes
checking for library containing setitimer... none required
checking for strcasestr... yes
checking for library containing strcasestr... none required
checking for memmem... yes
checking for library containing memmem... none required
checking for strlcpy... no
checking for uintmax_t... yes
checking for strtoumax... yes
checking for library containing strtoumax... none required
checking for setenv... yes
checking for library containing setenv... none required
checking for unsetenv... yes
checking for library containing unsetenv... none required
checking for mkdtemp... yes
checking for library containing mkdtemp... none required
checking for initgroups... yes
checking for library containing initgroups... none required
checking for getdelim... yes
checking for library containing getdelim... none required
checking for BSD sysctl... no
checking for POSIX Threads with ''... no
checking for POSIX Threads with '-mt'... no
checking for POSIX Threads with '-pthread'... yes
configure: creating ./config.status
config.status: creating config.mak.autogen
config.status: executing config.mak.autogen commands

4、make && make install

[root@localhost git-2.19.1]# make && make install
    * new build flags
    CC credential-store.o
In file included from credential-store.c:1:0:
cache.h:20:18: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
                  ^
compilation terminated.
make: *** [credential-store.o] Error 1

解决

[root@localhost git-2.19.1]# yum install zlib zlib-devel
[root@localhost git-2.19.1]# make && make install

5、配置环境变量

[root@localhost git-2.19.1]#echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
[root@localhost git-2.19.1]#source /etc/bashrc

6、检查版本

[root@localhost git-2.19.1]# git --version
git version 2.19.1

7、github帐号添加SSH keys

[root@localhost git-2.19.1]# ssh-keygen -t rsa -C"你的Git账号"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): #回车
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): #回车或输入密码
Enter same passphrase again: #在输一次
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:dbLagqimFQMLcl0oH+wH14TKyQ+k2L5BotlbrZPMNFM cashzhang27@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|   . ..+.        |
|  ..*.o .        |
|+o.O.*    o .    |
|=++ O E  . +     |
|o*o  *  S .      |
|o +o=.o. o       |
|  .O.=. o .      |
| .+.*    .       |
|.o.  .           |
+----[SHA256]-----+
[root@localhost git-2.19.1]# cat  ~/.ssh/id_rsa.pub
# 再把公钥粘到GitHub或Gitee上就ok了

 

CloudCompare 和 PCL:点云网格化分析与处理 点云网格化是将点云数据转化为规则网格的过程,其主要思想是将离散的点云投影到一个平面上,然后对该平面进行划分,形成一系列小区域。在点云网格化方面,PCL 提供了各种算法和工具,可以实现高效的点云网格化操作。以上示例代码中,首先加载了输入的点云数据,然后通过设置合适的网格化算法参数,如搜索半径和最大三角形边长等,执行了网格化操作,最后将网格化结果保存到输出文件中。以上示例代码中,首先加载了输入的点云数据,然后通过设置合适的网格化参数,如分辨率等,执行了网格化操作,最后将网格化结果保存到输出文件中。 阅读详情

相关推荐

手把手教你用DevExpress Patch工具解决VS项目中的试用弹窗问题

本文详细指导开发者使用DevExpress Patch工具解决Visual Studio项目中恼人的试用弹窗问题。核心在于理解并分步处理:首先正确应用补丁工具以绕过运行时验证,然后重点清理或重置项目中的licenses.licx文件以消除编译时验证,从而彻底根治弹窗。

weixin_29234423的博客 588

CentOS7安装git

CentOS7安装git,刚开始使用yum安装git,发现安装的版本默认是1.8.3.1,如果需要安装git最新版本,需下载git安装包。通过源码包安装需要下载依赖、解压、编译安装。Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。

luckySnow的博客 1万+

极验滑块验证码破解与研究(一):AST还原混淆JS

极验滑块验证码破解与研究(一):AST还原混淆JS声明一、环境安装1. node安装1.1. node下载1.2. 配置环境变量1.3. node安装检测1.4. pycharm配置node环境2. babel库安装2.1. babel库安装命令2.2. babel库安装检测二、AST还原混淆JS1. 模块导入2. AST还原流程3. 复制还原需要用到的js源码4. AST还原函数详解4.1. replace_unicode4.2. replace_unicode, replace_name_array,

帯泪的鱼的博客 1万+

Linux(Centos7版本)安装Git

Linux(Centos7版本)安装Git

Deng872347348的博客 6412

从SAR信号到洪涝地图:基于Sentinel-1数据的水体快速提取实战

本文详细介绍了如何利用Sentinel-1 SAR数据快速提取水体信息并生成洪涝地图的实战方法。通过预处理五部曲和SDWI指数计算,结合具体案例展示了SAR技术在洪涝灾害应急监测中的高效性和准确性,为救援决策提供关键支持。

weixin_29201313的博客 461

【STM32Cube_14】使用硬件I2C读写环境光强度传感器(BH1750)

本篇详细的记录了如何使用STM32CubeMX配置STM32L431RCT6的硬件I2C外设读取环境光强度传感器数据(BH1750)

Mculover666的博客(嵌入式) 7240

centos7安装git

centos7安装git

weixin_42400413的博客 596

使用 Python 爬虫抓取 IMDb 电影信息 - 评分、评论与基本信息抓取教程

本文介绍了如何使用 Python 爬虫技术抓取 IMDb 电影评分、评论和基本信息。我们分别展示了通过IMDb API和两种方法抓取数据,并进行了数据存储、分析与可视化。在未来,我们还可以基于这些数据开发电影推荐系统、情感分析工具等,进一步丰富电影数据的应用场景。通过这些实践,您不仅学会了如何抓取和存储数据,还可以通过这些基础来构建自己的数据分析应用,获取更丰富的电影数据。

2201_76125261的博客 601

Centos7源码编译安装git

本次使用Centos7和gitv2.42.0版本演示。

seclionys的博客 539

微服务架构的实施与挑战:前提判断、三种落地模式、收益兑现与风险应对

微服务是用运维复杂度换取演进自由度的一笔交易,是否划算取决于系统复杂度是否越过生产率曲线的交叉点。本文先给出实施前提:微服务溢价的六项成本、四项前置能力、康威定律与领域边界,并附就绪度自检表;再拆解三种落地模式:以绞杀者为代表的渐进剥离与数据五级迁移、以模块化单体起步的绿地建设、新旧并行的混合式集成;随后逐项审视六大技术优势与组织收益的兑现条件,系统梳理分布式谬误、分布式单体、Saga与幂等、弹性容错、可观测性、契约测试等挑战与对策,最后给出四阶段落地路线、DORA四项度量与常见反模式清单。

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 172万+

最全教程cadence建立个人CIS数据库

此时如果你删除office365,再装Access数据库,可以安装上,然后你再装office365,系统又会把Access软件给你删除掉,因为冲突了。可以在自己的电脑上新建CIS库,主要包含下面几个内容:数据库文件,原理图封装,PCB封装,数据手册,另外建议做一个器件命名的说明。allegro在调用封装的时候,是看的.psm文件,而不是.dra文件,因此只要是c0402.psm,那么所有的内容都要保持一致。(1)文件夹不要有中文,不要有空格,否则无法识别,可以参考博主的方式,全部使用英文输入法下划线。

D_Katter的博客 247

如何在 Centos 7.x 上以源码包安装最新版 Git

如何在Centos 7.x上以源码包安装最新版Git 注意:如果安装的不是最新版或者系统已经有安装Git,请执行下面的操作 # yum remove -y git # source /etc/bashrc # git --version 步骤1. 安装依赖包 # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-...

weixin_30640769的博客 133

机器人外接 USB 音响完整配置指南

摘要:本文介绍了为机器人配置外接音响的方法。由于内置音响音量小且有散热噪音,建议使用Type-C接口外接音响。配置步骤包括:1)通过aplay -l命令查看音响端口信息;2)使用aplay命令测试音频播放;3)通过amixer命令设置音量。关键点在于正确识别音响的卡号(如card 2)和设备号(如device 0),并在命令中准确配置这些参数即可实现外接音响的正常使用。

m0_47999117的博客 356

CentOS7源码安装git最新版本

CentOS7源码安装git最新版本

Levy_96的博客 543

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

[Ubuntu/CentOS7]--源码安装git最新版

git安装方式 源码编译安装git 下载最新版源码 安装依赖包 编译安装 添加git命令自动补全 在线安装 光盘自带包安装git安装方式git的安装方式,我常用的是三种:在线安装、光盘自带包安装、源码安装。我一般喜欢用源码安装,主要是因为源码安装,可以实时安装最新版,关键还能加强自己对linux的熟悉程度。源码编译安装git下载最新版源码下载地址https://www.kernel.org/pub/

Awsmsniper的博客 1507

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

【git】centos7 git 源码安装最新版本

1,下载源码 wget https://github.com/git/git/archive/v2.26.0.tar.gz 2.解压 tar -zxvf v2.26.0.tar.gz 3.进入解压目录 cd git-2.26.0 4.编译 make prefix=/usr/local/git all 5.安装 make prefix=/usr/local/git in...

阿来小同学的博客 413

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

centos7编译安装最新版Git

安装依赖包 yum -y install zlib-devel curl-devel openssl-devel perl cpio expat-devel gettext-devel openssl zlib autoconf tk perl-ExtUtils-MakeMaker 获取最新版 Git 源码包 从 https://github.com/git/git/

有梦就能飞 1458

linux centos7 安装最新版git 教程

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_33971205的博客 118

CentOS 7安装GIT并配置环境变量多种方式

文章目录 方式一:通过 wget 下载压缩包,然后 tar 解压,最后which git路径是/usr/lib 我之前用的 centos 6.6 中有默认 git 是 1.7.1 的版本,但是 github 中要求 git 最好不要低于 1.7.2,这就很尴尬了,centos 7 我查了 which git 没有,我打算下一个高一点版本的 git,那使用 centos 7 的 yum 的 inst...

abcnull 的博客 1768

CentOS 7.4升级curl和git到最新版本

CentOS 7.4升级curl和git到最新版本 升级curl和git到最新版本 [root@jenkins ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker [root@jenkins ...

DB2_c的博客 1052

centos7安装最新版git

由于在使用码云过程中的错误,导致必须安装最新版的git,所以记录下安装过程! 1、查看已有git版本 # git --version git version 1.7.112 2、查看 yum 源仓库的 Git 信息 # yum info git1 可以发现yum 源仓库里的 Git 版本并不是官网上的最新版本2.9.2,想要安装最新版本的的 Git,只能下载源码进行安装。 ...

dev_zyx的博客 1155

CentOS 7安装最新版本Git

CentOS 7安装最新版本git 2018/6/21 19:38:24 进入/usr/local目录,使用mkdir git创建git目录 git --version查看自带的版本 使用如下命令安装编译环境和依赖 yum install curl-devel expat-devel gettext-devel openssl-devel zli...

weixin_30752377的博客 117

CentOS 7 - 安装 Git

文章目录CentOS 7 - 安装 Git环境信息准备GCC - C & C++ 编译器Wget - 非交互式网络下载器安装下载源码包重新编译与安装重新编译的过程可能遇到的错误错误 1 - fatal error: openssl/ssl.h: No such file or directory错误 2 - fatal error: curl/curl.h: No such file or directory错误 3 - fatal error: expat.h: No such file or d

qq_29761395的博客 2057

DevOps工具链(二)——CentOS7.4源码安装git最新版本

各软件版本: 操作系统:CentOS 7.4 Git:2.17.0 系统用户:root 1. 安装环境 # 安装gcc [root@localhost bin]# yum install gcc # 安装gcc-c++(不确定是否非必须) [root@localhost bin]# yum install gcc-c++ # 安装编译...

gezilan的博客 354

CentOS7 安装最新版Git

CentOS7 安装最新版GitGit 地址:https://github.com/git/git安装wgetyum install -y wget安装gityum install -y git安装gccyum install gcc安装g++yum install gcc-c++下载gitwget -P /usr/software https://www.kernel.org/pub/softwa

jeikerxiao 4182

linux中git安装步骤,linux配置安装 git 详细教程

Git是目前流行的非常好用的版本控制工具,这里介绍两种安装方式,1、yum安装,2、从github上下载最新的源码编译后安装一、环境介绍系统:linux镜像:CentOS-7-x86_64-DVD-1804.iso二、源码安装1.yum安装有个缺点,版本不好控制。如果想要使用最新版的git,得自己下载最新源码安装。所以这里我们进入git 在GitHub上发布版本页面https://github.c...

weixin_34701183的博客 2148
上一篇: Docker 安装GitLab
下一篇: CentOS7 常用命令
cashZhang27
博客等级 码龄10年 22粉丝 67原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值