【拍错】gitHub报错异常:[rejected]
2020年04月30日 11:47:41 作者:Jiaozn 分类:Git 评论(0)$ git push -u origin master
To https://github.com/szySunzhouyu/python.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/szySunzhouyu/python.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
出现问题的原因:
github中的有些文件不在本地代码目录中
解决办法:
$ git pull --rebase origin master #执行这一步。
结果:
本地代码目录下出现gitHub中文件
此时 再执行以下操作 代码成功上传至github
git push -u origin master
除非注明,发表在“Jiaozn的博客”的文章『【拍错】gitHub报错异常:[rejected]』版权归Jiaozn所有。
转载请注明出处为“本文转载于『Jiaozn的博客』原地址https://jiaozn.com/reed/572.html”
评论
发表评论