一、建立本地和github的连接
1.1 生成本地秘钥,执行如下命令
ssh-keygen -t rsa -C "danishlyy@163.com"
1.2 打开秘钥文件,获取秘钥
文件位置
C:\Users\zengyue\.ssh\id_rsa.pub
秘钥内容:文件内的所有内容;
1.3 github 许可秘钥
打开github,点击 Settings-> SSH and GPG keys,点击建立新的秘钥,输入名字,粘贴复制的秘钥内容;
如此,即建立了连接;
2. 推送代码到 github
2.1 初始化
git init
2.2 关联新的仓库
git remote add github git@github.com:zy-nju/Demo.git
2.3 添加新文件
git add ex1data1.txt
2.4 提交修改
git commit -m "first submit"
2.5 推送文件到 github
# 首次提交
git push -u origin master
# 非首次提交
git push