计算机专业学习笔记

Linux 安装git

2019-09-16  本文已影响0人  席坤
yum remove git
wget https://github.com/git/git/archive/v2.21.0.tar.gz
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
tar -zxvf v2.21.0.tar.gz
cd git-2.21.0/
make prefix=/usr/local/git all
make prefix=/usr/local/git install
vim /etc/profile
# 末尾添加
export PATH=/usr/local/git/bin
source /etc/profile
git --versiob
git config --global user.name "nameVal"
git config --global user.email "eamil@qq.com"
 git config --global core.autocrlf false
 git config --global core.quotepath false 
 git config --global gui.encoding utf-8

git 公钥配置

ssh-keygen -t rsa -C "xx@163.com"

如果出现 Could not open a connection to your authentication agent.

 eval `ssh-agent`

出现

Agent pid 14578
ssh-add ~/.ssh/id_rsa

此时出现

Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
cat ~/.ssh/id_rsa.pub

出现的一串字符串填入git

此时可以使用 SSH 克隆代码

git clone git@github.com:xxx/xxx.git
上一篇 下一篇

猜你喜欢

热点阅读