使用git上传本地文件夹到远程仓库,使用如下命令:git push -u origin master时报错

git上传文件夹报错: ! [rejected]        master -> master (fetch first) error: failed to push some refs to 'https://github.com/taminachen/rjxm.git' hint: Updates were rejected because the remote contains work

原因是在GitHub创建仓库时创建了readme文件,但是本地没有这个文件,造成本地目录与远程目录不一致。

解决方法:使用命令git pull --rebase origin master进行合并

git上传文件夹报错: ! [rejected]        master -> master (fetch first) error: failed to push some refs to 'https://github.com/taminachen/rjxm.git' hint: Updates were rejected because the remote contains work

再次上传,成功!

git上传文件夹报错: ! [rejected]        master -> master (fetch first) error: failed to push some refs to 'https://github.com/taminachen/rjxm.git' hint: Updates were rejected because the remote contains work

 

相关文章:

  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2021-08-28
  • 2021-05-28
  • 2021-07-08
  • 2021-04-26
  • 2021-12-30
猜你喜欢
  • 2022-01-15
  • 2021-12-13
  • 2022-01-04
  • 2021-03-28
  • 2022-12-23
  • 2019-05-16
  • 2021-04-12
相关资源
相似解决方案