提前准备
下载地址
https://git-scm.com/download
git安装步骤
https://www.jianshu.com/p/7edb6b838a2e
查看电脑是否安装git
在终端中输入git
mac .ssh文件在哪里查找
Finder-->前往-->前往文件夹-->输入~/.ssh
出现的问题(lease make sure you have the correct access rights and the repository exists 问题.)
公钥出问题了,需要删除.ssh下文件,然后重设置用户名和邮箱再重新生成ssh公钥即可解决
先吧.ssh文件下的所有文件进行删除
然后使用git进行设置
1.设置用户名
git config --global user.name ‘提交代码的用户名’
2.设置用户名邮箱
git config --global user.email ‘邮箱地址’
3.查看设置
git config --list
然后在输入ssh-keygen -t rsa -C "邮箱地址"(一路回车就可以了)
然后在使用命令 open .ssh/id_rsa.pub 查看文件,复制内容
最后在github配置ssh key进行通信
github配置ssh key(插入图片的顺序有点问题)
验证是否连接成功
sh -T git@github.com
出现一下内容证明连接成功