github 提交代码需要使用 SSH 公钥进行认证,一般情况下,用户的 SSH 密钥存储在其 ~/.ssh 目录下。

进入该目录并列出其中内容,你便可以快速确认自己是否已拥有密钥。如果没有则可以生成一个新的 SSH 密钥。

生成密钥

ssh-keygen -t rsa -C "xxxxx@xx.xxx"

配置name和email

git config –global user.name 'xxxxx' 
git config –global user.email 'xxx@xx.xxx'

远程仓库

git remote add origin xxxxxx # 添加远程仓库
git remote set-url origin xxxxxx # 修改远程仓库
git remote -v  # 查看远程仓库
git remote rm origin # 删除远程仓库

本站由 灰糖 使用 Stellar 1.33.1 主题创建。