1.下载安装git
安装依赖包
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
下载git压缩包
$ https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
解压、编译:
$ tar -zxvf git-2.8.3.tar.gz & cd git-2.8.3
$ ./configure prefix=/usr/local/git/
$ make && make install
查看是否安装完成
$ git --version
2.全局git
$ ln -s /usr/local/git/bin/git /usr/bin/git
3.生成ssh秘钥
$ ssh-keygen -t rsa -C “test@gmail.com”
之后进入
$ ~/.ssh/
查看公钥
$ cat id_rsa.pub
将内容复制到远程git仓库认证 就可以使用了
网友评论