文章目录
0 git设置
下载git
打开git bash, 之后进行设置
git config --global user.name scchy
git config --global user.email aaa@mail.com
git config --global push.default matching
1 设置ssh连接
可以打开 ssh-key 设置页面查看
// open git bash
ssh-keygen -t rsa -b 4096 -C "aaa@mail.com"
cat ~/.ssh/id_rsa.pub
// 将内容复制到GitHub NEW SSH KEY
github 设置NEW SSH KEY
将cat 内容复制到 下面的KEy
1.1 查看密钥&查看调试信息
// 查看加入的密钥列表
ssh-add -l
// 查看调试信息
ssh -v git@github.com
1.2 当(git)ssh名字非默认id_rsa时
ssh-agent bash
ssh-add ssh的命名
ssh-add -l // 查看加入的密钥列表
ssh -v git@github.com // 查看调试信息
2 上传项目到git & clone 项目
2.1 上传
// 0- 添加节点
git remote set-url --delete origin
git remote add origin_learn git@github.com:scchy/xxxxxxx
git init
git add .
git commit -m '项目上传:scchy_update:xxxxx'
// 当 git push -u origin_learn master 报错时, 加上 -f
git push -f -u origin_learn master
这样就把项目上传到gihub上了
需要注意: 该方法上传是全覆盖的方式
2.1.1 节点的ssh获取
2.2 Clone
git clone https://github.com/xxxxxxx