当前位置:   article > 正文

Error:rejected Updates were rejected because the remote contains work that you do not have locally

rejected updates were rejected because the remote contains work that you do

VS 中使用gitee插件进行推送时出现错误:

发布到远程存储库时遇到错误: 

  1. Error: failed to push some refs to '..........'
  2. Error: hint: Updates were rejected because the remote contains work that you do
  3. hint: not have locally. This is usually caused by another repository pushing
  4. hint: to the same ref. You may want to first integrate the remote changes
  5. hint: (e.g., 'git pull ...') before pushing again.
  6. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  7. 发布到远程存储库时遇到错误: rejected Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes before pushing again.

解决方法:

 输入:

git pull origin master --allow-unrelated-histories

是一个 Git 命令,它用于将远程仓库(通常是名为 "origin" 的远程仓库)中的更改合并到当前分支,同时允许合并不相关的历史。

当你运行 git pull origin master --allow-unrelated-histories 命令时,你正在告诉 Git 忽略这个 "unrelated histories" 限制,强制将远程分支("origin" 的 "master" 分支)的历史与当前分支合并,即使它们不共享共同的祖先。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/635390
推荐阅读
相关标签
  

闽ICP备14008679号