开发者社区> 问答> 正文

我提交osc。git报错?报错

$ git push origin master
To https://git.oschina.net/arraylist7/MultiFileSelector.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://git.oschina.net/arraylist7/MultiFileSelector.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


这个是什么意思啊

展开
收起
爱吃鱼的程序员 2020-06-10 15:24:29 611 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <divclass="container"><divclass="linenumber1index0alt2">我用gitremotermorigin之后,在次addorigin,pushmaster也是这个错
    试试添加-f参数进行强制推送谢谢加上-f就可以了。本地推送有冲突,先gitpull拉取最新代码,解决冲突,再gitpush我是直接在eclipse里面写的代码,写的差不多了,打算提交到git的。然后今天才在git上创建的项目。这样也会有冲突?你初始化的并不是一个空仓库,本地推送是-f即可,也可以gitfetch,gitmerge,下次初始化空仓库即可。
    3Q,我加上-f就提交成功了。

    2020-06-10 15:24:47
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
新一代高效Git协同模型 立即下载
AGit-Flow:新一代高效Git协同模型 立即下载
AGit-flow:新一代高效Git协同模型 立即下载

相关实验场景

更多