Git之旅(1):安装git

一、在windows中安装git

git官网:https://git-scm.com/downloads

 二、在centos系统安装git

2.1 配置base源和epel源

# cat /etc/yum.repos.d/aliBase.repo
[aliBase]
name=aliBase
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-$releasever
 
# cat /etc/yum.repos.d/aliEpel.repo
[aliEpel]
name=aliEpel
baseurl=https://mirrors.aliyun.com/epel/$releasever\Server/$basearch/
enabled=1
gpgcheck=0

2.2 yum命令下载

# yum install -y git

2.3查看是否下载成功

# git --version

三、初始化配置

3.1设置用户名跟邮箱

$ git config --global user.name "lzw"
$ git config --global user.email "[email protected]"

3.2查看全局配置

$ git config --global --list

猜你喜欢

转载自www.cnblogs.com/lizhewei/p/11806714.html