一、Open Git Bash
进入ssh文件夹
cd ~/.ssh
生成一个ssh密钥对(公私钥)
ssh-keygen -t rsa -C "<github主邮箱>"
接下来三个参数置空即可
Enter file in which to save the key (...):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
查看并复制公钥
cat id_rsa.pub
二、Check in GitHub
settings---SSH and GPG keys---新建SSH key
粘贴密钥完成SSH建立
三、Use SSH to Clone
四、Pay Attention(该部分取自 AI日日新 文章)
若远端仓库有其他贡献者,在修改你的内容之前需要拉取更改
git pull
接着进入仓库文件夹。修改完项目内容后添加更改
git add .
然后提交
git commit -m <更改的内容描述>
最后将更改推送到远端
git push -u origin main