linux centos安装git
1.安装依赖
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils- MakeMaker
2.下载
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
3.解压
tar -zxvf git-2.9.5.tar.gz
4.进入git
cd git-2.9.5
5.执行make放到指定路径
make prefix=/usr/local/git all
6.执行make安装
make prefix=/usr/local/git install
7.增加环境变量
7.1打开配置文件
vim /etc/profile
7.2增加变量
/usr/local/git/bin
7.3使配置生效
source /etc/profile
8.查看版本
git --version
9.配置git
git config --global user.name “xxx”
git config --global user.name “xxx@qq.com”
git config --global core.autocrlf false
git config --global core.quotepath off
git config --global gui.encoding utf-8
10.设置公钥
10.1生成公钥
ssh-keygen -t rsa -C “xxx@qq.com”
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
10.2查看公钥
cat ~/.ssh/id_rsa.pub
10.3在码云中添加公钥
复制公钥
打开码云登录后在右上角下拉菜单中点击设置后点击ssh公钥选项在对应位置上添加公钥