Git02-安装git
- Git官网:https://git-scm.com/
1、在centos上安装git(源码)
1、安装依赖
]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker asciidoc xmlto
2、下载git
https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.8.tar.gz
3、解压安装包
]# tar zvfx git-2.30.8.tar.gz ]# cd git-2.30.8/
4、编译安装有两种
- (1)仅安装git工具,不安装git文档
//1)编译 ]# make prefix=/usr/local/git all //2)安装 ]# make prefix=/usr/local/git install
- (2)安装git工具,同时安装git文档
//1)安装docbook2X ]# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/d/docbook2X-0.8.8-17.el7.x86_64.rpm ]# yum install docbook2X-0.8.8-17.el7.x86_64.rpm ]# ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi //2)编译 ]# make prefix=/usr/local/git all doc info //3)安装 ]# make prefix=/usr/local/git install install-doc install-html install-info
5、添加环境变量
]# vim /etc/profile export PATH="/usr/local/git/bin:$PATH" ]# source /etc/profile
2、在windows上安装git
- 下载:https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe
1
# #