当前前提:
1: 拥有github登陆账号
2: mac电脑
本文所述:
1: 创建一个新的私有工程
2: 配置sshKey和用户信息
3: 实现 clone 和 push 操作
流程1:创建一个新的私有工程
1) 登陆github https://github.com/
2) 点击new

3)配置

结果1:

流程2:配置
1) 生成SSHKey
ssh-keygen -t rsa -C "这里换成你的邮箱@163.com"

2) 查看自己生成的SSHkey
cat ~/.ssh/id_rsa.pub
终端中打印
ssh-rsa AAAxxxxxxxxxxxxxxxxxwPA+OD xxxxxxxxxx@163.com
然后整块复制, 包括前面的ssh和后面的邮箱
3) 进入github设置页面

4) 进入SSHkey设置入口

5) 输入SSHKey

6) 测试SSHkey
终端中输入
ssh -T git@github.com

流程3:配置用户信息
7) 配置github API Token
右上角头像->setting->找到入口


把几个主要的权限勾上后点击保存

然后注意会生成一段 API token
7) 配置本地用户信息
终端中配置代码如下
git config --global user.name "Twins"
git config --global user.email "xxxxxxx@163.com"
git config --global github.user q70740930
git config --global github.token xxxx生成的 API tokenxxxxxxxxxxxxx
网友评论