Windows
安装
安装Git,访问下面网址进行下载
https://www.git-scm.com/download/
配置
安装后,找到 Git Bash
,进行简要配置
输入
git config --global user.name “hardy”
git config --global user.email “hardy9sap@163.com”
Linux
Step1: 卸载自带的git版本
yum -y remove git
Step2: 安装依赖
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum -y install gcc perl-ExtUtils-MakeMaker
Step3: 下载git 2.7.3
cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz
Step4: 安装git 2.7.3
tar xzvf git-2.7.3.tar.gz
cd git-2.7.3
make prefix=/usr/local/git all
make prefix=/usr/local/git install
cd /usr/bin
ln -sf /usr/local/git/bin/git git
Step5: 测试
git --version
说明
配置Git时,git config
--global
是基于用户配置,在用户家目录下生成 .gitconfig
文件--system
是基于系统配置,在/etc生成文件--local
是基于仓库配置,前提是有仓库并在仓库下的.git/config
存储信息
查看配置信息
- cat ~/.gitconfig
- git config --list
来源:CSDN
作者:爱喝水的qdy
链接:https://blog.csdn.net/qq_32617703/article/details/103585784