出错原因:上传前,本地与GitHub上远程仓库内容不一样
解决方法:上传前,先进行下拉操作,同步本地与远程库
git init // 初始化本地库
git add files // 添加到暂存区
git commit -m "desc" // 提交到本地版本库
git remote add zidingyi + GitHub仓库地址 // 绑定
git pull zidingyi master // 下拉
git push -u zidingyi master // 上传
出错原因:上传前,本地与GitHub上远程仓库内容不一样
解决方法:上传前,先进行下拉操作,同步本地与远程库
git init // 初始化本地库
git add files // 添加到暂存区
git commit -m "desc" // 提交到本地版本库
git remote add zidingyi + GitHub仓库地址 // 绑定
git pull zidingyi master // 下拉
git push -u zidingyi master // 上传