一、 安装git
Windows 10下安装Git
https://git-scm.com/download/winLinux下安装Git:
https://git-scm.com/download/linuxMac 安装Git:
https://git-scm.com/download/mac
二、ssh key、配置git
1、设置username和email
git config --global user.name “此处填写你的邮箱前缀”
git config --global user.email "此处填写工作邮箱"
2、通过终端命令创建ssh key
ssh-keygen -t rsa -C “此处填写工作邮箱”
3、config配置
- .ssh/config 常用配置 https://www.cnblogs.com/hangj/p/11506686.html
- (>和>>)的区别 https://jingyan.baidu.com/article/948f59240ef17dd80ff5f9ba.html
echo "Host gerrit_me" >> ~/.ssh/config
echo "HostName gerrit ip地址/域名" >> ~/.ssh/config
echo "Port 29418" >> ~/.ssh/config
echo "User gerrit登录的用户名" >> ~/.ssh/config
echo "IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
配置public key
-
cat本机电脑上~/.ssh下的id_rsa.pub粘贴到Settings 内的SSH Public Keys