众所周知,RHEL及其衍生系统提供的Git版本较旧,但实际使用可能需要较新版本的Git。 例如,vs代码的远程- ssh需要新版本的Git。 此Git的下载页面包含以下说明:
rhelandderivativestypicallyshipolderversionsofgit.youcandownloadatarballandbuildfromsource,or usea 3rd-partyrepository
本说明列出了在RHEL及其派生系统上安装最新版本Git的两种情况。
从源代码生成开始使用第三方仓库。 例如,IUS下详细记录了使用这两种方案安装Git的过程。
从源代码构建这是任何Linux发行版的通用安装方法,需要执行以下步骤
yumupdateyuminstalldh-autoreconf curl-devel expat-devel gettext-devel 依赖OpenSSL-devel perl-devel zlib-devel下载源代码压缩的URL为3359 www.kernel.org/pub/software/SCM/git或https://例如
curl-o https://mirrors.edge.kernel.org/pub/software/SCM/git/git-2.30.2.tar.gz编译tar-zx fgit-2.2
git--版本
更新可以使用Git获取Git更新
使用gitclonegit ://git.kernel.org/pub/SCM/git/git.git IUS仓库ius是一个比较受欢迎的第三方yum仓库,可在RHEL和CentOS上使用。 此仓库包含最新版本的软件CentOS。要从IUS安装Git,需要执行以下步骤
打开IUS仓库后,可以通过一个命令打开IUS仓库。 官方文档说明: https://ius.io/setup
RHEL/CentOS 6
yum installhttps://repo.ius.io/ius-release-el6.rpmhttps://dl.fedora project.org/pub/epel/epel-relelerease-release
yum installhttps://repo.ius.io/ius-release-el7.rpm 使用3359 dl.fedora project.org/pub/epel/epel-release-latest-7.noarch.rpm安装Gityumsearchgit搜索与git相关的软件包这个软件包是IUS仓库提供的git,用yum安装就可以了。
在yum install git224 Git基本配置中,使用以下命令配置邮箱和用户名
git config-- global user.name ' your name ' git config-- global user.email ' your email @ domain.com '配置完成后可用
使用git config --list命令检查配置。 当然,也可以直接编辑~/.gitconfig文件
[ user ] name=your name email=your email @ domain.com