- 注册GitHub账号
- 创建远程仓库
- 本地代码推送到远程仓库
注册(略)
创建仓库
根据提示执行代码
上传成功
如果有其他分支可以继续push
第一次上传代码遇到很多问题
问题一:
fatal: unable to access 'https://github.com/xxx/yyy.git/': OpenSSL SSL_read: Connection was reset, errno 10054
解决方法
git remote rm origin
git remote add origin git@github.com:xxx/yyy.git
git push origin master
# *注意:我的项目分支名称为master 所以此处是master(根据自己情况git rush (-u) origin 分支名称)
问题二:
fatal: unable to access 'xxx': Failed to connect to github.com port 443 after 21129 ms: Timed out
网不好 多试几次或等会再试
问题三:
fatal: Authentication failed for 'https://github.com/ ...
解决方法:
因为前面我用户名和邮箱是随便输入的,需要重新配置
git config --global user.name "xxx"
git config --global user.email "xxx@xxx.com"
问题四:
Warning: Permanently added‘github.com’ (RSA) to the list of known hosts......
解决方法:
- 打开git bash
- 输入
cd C:
- 再输入
cat ~/.ssh/id_rsa.pub
- 输入
ssh-keygen
- 然后重复回车,会生成一个矩形,说明公钥已经生成了,重复步骤3,生成publickey,右键“copy”复制
- 登录github操作