美文网首页
git提交步骤

git提交步骤

作者: HonGz | 来源:发表于2019-08-29 18:34 被阅读0次
安装git

https://git-scm.com/downloads

配置用户

git config --global user.name "Your Name"
git config --global user.email "email@example.com"

创建SSH Key

ssh-keygen -t rsa -C "youremail@example.com"

  • 在用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人。
登陆GitHub,打开“Account settings”

SSH Keys”页面:然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容

创建远程仓库

登陆GitHub,在右上角找到“new repository”按钮,点击创建一个新的仓库

连接远程仓库

git remote add origin git@github.com:用户名/仓库名.git

把所有内容推送到远程库上

git push -u origin master

相关文章

网友评论

      本文标题:git提交步骤

      本文链接:https://www.haomeiwen.com/subject/znrwectx.html