成功解决:Updates were rejected because the tip of your current branch is behind its remote...【解决方法】

这篇具有很好参考价值的文章主要介绍了成功解决:Updates were rejected because the tip of your current branch is behind its remote...【解决方法】。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、报错发生

最近使用git,一直使用命令行操作。昨天突发奇想研究了一番git的GUI,结果由于操作不当产生了如下报错:

Updates were rejected because the tip of your current branch is behind its remote counterpart.

二、报错原因

该报错在git push时出现,一句话解释就是你在本地仓库上的修改没有基于远程库最新版本,本地仓库版本落后于远程仓库。这个报错告诉我们在本地开发的时候,要经常使用git pull获取远程分支最新改动,这样才能保证在最终git push的时候本地commit历史和远程commit历史是一致的。

或者,起初本地仓库和远程仓库是同步的,不过有多个人都在该分支上开发,另一个人在某一天做了修改并提交到远程库了。此时远程库和你的本地库就不同步了。后续同场景一。

三、解决方法

先pull一下:

git pull origin


再push:

git push origin main
git push origin master


接下来的继续正常操作即可。文章来源地址https://www.toymoban.com/news/detail-532106.html

到了这里,关于成功解决:Updates were rejected because the tip of your current branch is behind its remote...【解决方法】的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 解决gitpush时报错:hint: Updates were rejected because the remote contains work that you do hint: not have

    当我新建了一个git仓库,依次执行 却报错 报这个错是因为远程仓库和本地仓库文件不同步,解决方法是先执行git pull将远程仓库文件拉下来使得远程与本地同步。 解决步骤 1.执行 这里的webbrowser换成你的远程仓库名 执行后会有如下输出 2.再试试重新推送行不行 发现还是报错

    2024年02月16日
    浏览(42)
  • git 报错:Updates were rejected because the remote contains work that you do问题

    刚开始学习使用git,通过push命令:打算将本地仓库中的文件上传到远端仓库时,报了以下错误: 原因:远程仓库不为空:自己在创建远程仓库的时候,添加了如下两个文件,本地仓库中并没有这两个文件。 解决方法:添加:–allow-unrelated-histories 将远端的本地文件首先拉取到

    2024年02月11日
    浏览(45)
  • 【Github】hint: Updates were rejected because the remote contains work that you do && remote: error: G

    Q: git push 报错 翻译 A:这是因为在上传的时候,远程仓库中有着本地仓库没有的文件(与远程仓库的内容不一致),即导致本地仓库和远程有不同的开始点,也就是两个仓库没有共同的 commit ,所以无法提交,解决方法如下: 参考教程https://www.cnblogs.com/yanhuidj/p/9301328.html 正确的

    2024年02月03日
    浏览(32)
  • git 提交出现 Updates were rejected 解决方案记录

    git remote add 添加一个远程地址 但提交出现以下报错 VBNET 复制 全屏 解决 也就是说,如果您确定处于分离状态的master版本是您真正想要保留的版本,那么您可以通过强制将分支推送到远程来避免非快进错误: git push origin HEAD:master --force 但是,如果强制推送,则可能会给签出该

    2024年02月07日
    浏览(30)
  • 成功解决RuntimeError: Failed to import transformers.models.llama.tokenization_llama_fast because of the

    成功解决RuntimeError: Failed to import transformers.models.llama.tokenization_llama_fast because of the following error (look up to see its traceback): tokenizers=0.13.3 is required for a normal functioning of this module, but found tokenizers==0.12.1 目录 解决问题 解决思路 解决方法 T1、pip命令 T2、conda命令 RuntimeError: Failed to im

    2024年02月11日
    浏览(37)
  • 完美解决None of the following candidates is applicable because of receiver type mismatch:

    最近遇到一个错误,记录一下,网上搜索发现其他网友说可能是Kotlin版本问题,尝试升级Kotlin和降低Kotlin版本试试,下面是我遇到的情况。 错误日志 出现错误位置: 解决方法 1、点击Build下的Clean Project ,运行测试 2、若是1步骤不成功,则点击Build下的Rebuild Project,再次运行

    2024年02月06日
    浏览(47)
  • FileUploadException: the request was rejected because no multipart boundary was found

    前端使用 form 提交文件到后端。 使用 jquery/axios/fetch 或其他HTTP客户端程序发送HTTP请求,但是后端(Spring框架)报错如下: 我是因为设置了 \\\"Content-Type\\\": \\\"multipart/form-data\\\" 这样的头,才会失败。 这个请求头的格式样例(见https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type):

    2024年02月10日
    浏览(41)
  • fileupload.FileUploadException: the request was rejected because no multipart boundary was found

    前端小程序调用服务端的文件上传接口,有一台安卓机上传一直报错: 报错日志: {\\\"statusCode\\\": 500, \\\"header\\\": {\\\"Date\\\": \\\"Wed, 29 Mar 2023 06:45:39 GMT\\\", \\\"Content-Language\\\": \\\"en\\\", \\\"Server\\\": \\\"nginx\\\", \\\"Content-Type\\\": \\\"text/html;charset=utf-8\\\", \\\"Transfer-Encoding\\\": \\\"chunked\\\", \\\"Connection\\\": \\\"keep-alive\\\", \\\"protocol\\\": \\\"http/1.1\\\"}, \\\"data

    2024年02月03日
    浏览(55)
  • 解决CitSpace分析新版本web of science文献报错“the timing slicing setting is outside the range of your data”

    新版web of science于2021年7月7日上线,旧版 Web of Science 将同步运行到2021年底。现在旧版web of science入口早已关闭,新本web of science的残产品中也不在提供旧页面入口。 近来在使用web of science文献制作CiteSpace图谱时发现,web of science导出的文献数据在CiteSpace跑的时候都会出现“th

    2024年02月02日
    浏览(34)
  • 解决Correct the classpath of your application so that it contains compatible versions

    springboot启动失败 报错Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.web.servlet.handler.AbstractHandlerMethodMapping and org.springframework.web.method.HandlerMethod 排查发现:pom依赖同时引用了两个不同版本的web包。 删掉一个web依赖重新构建以后问题直

    2024年02月09日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包