【git 报错】:git push 提示error:failed to push some refs to “xxxxxx“

这篇具有很好参考价值的文章主要介绍了【git 报错】:git push 提示error:failed to push some refs to “xxxxxx“。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

1、问题描述

在git push操作提交一个文件到远程库的时候报错:error: failed to push some refs to ‘https://gitee.com/gitee-zhangchq/stm32.git’
翻译:

错误:无法将某些引用推送到’https://gitee.com/gitee-zhangchq/stm32.git’

git error: failed to push some refs to,# git,git,github

2、错误原因

由于这是一个在gitee上面新创建的一个远程库,然后在创建远程库的时候还选择了自动生成readme文档,这时候在远程库是有两个文件 :README.en.md README.md
然而在本地我是直接创建一个目录,git init 初始化一个本地库,然后添加一个文件夹document下放一个中文文档,这个时候的本地就少了远程库的README.en.md README.md这两个文件,所以在git push的时候就会报错;

3、问题解决

这个报错的原因就是有本地库缺少远程库有的部分文件导致,这时候只要将远程库同步到本地库,然后再提交就可以了:
使用指令:

git pull --rebase stm32 master //stm32为远程库名 master为远程库分支

git error: failed to push some refs to,# git,git,github
rebase之后再次push就成功了:
git error: failed to push some refs to,# git,git,github文章来源地址https://www.toymoban.com/news/detail-581427.html

到了这里,关于【git 报错】:git push 提示error:failed to push some refs to “xxxxxx“的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

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

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

相关文章

  • git上传文件到Gitee报错“error: failed to push some refs to ‘https://gitee.com/xxxx”

    我要将一个 4.27 GB 的文件上传到 Gitee 上,但是出现了下面这样的报错 error: failed to push some refs to \\\'https://gitee.com/xxxx/centos.git 因此记录一下解决报错的方法。 创建一个新的项目仓库,可以参考我之前写的博客Pycharm集成Gitee及使用,我这里新建了一个名字为 Centos 的仓库。 1、在

    2024年02月12日
    浏览(43)
  • git push报错:![rejected] master -> master(non-fast-forward) error:failed to push some refs to XXX

    背景 本地git库,要push到gitlab上,执行完如下命令后报错: 报错信息为: 原因 从本地代码创建远程仓库的时候,添加了README.md,但本地仓库中并没有该文件。 解决方案 添加忽略不相干的历史选项,将远程仓库中的文件重新拉取到本地,这样本地文件会出现README.md: 之后再

    2024年02月04日
    浏览(48)
  • git使用push命令报错-error: failed to push some refs to ‘https://gitee.com/MFLU/graduation_design.git‘

    当我们使用git操作向远程仓库push代码时,可能会报错: 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. 主要原因

    2024年02月04日
    浏览(34)
  • git push 到gitlib提示! [rejected] master -> master (non-fast-forward) error: failed to push some refs t

    一、git push到gitlab提示,大概意思是本地库和远程库没有同步导致无法提交合并,冲突导致无法push。 二、解决方案 三、操作界面,可以push到gitlab了。 三、參考文章 https://www.cnblogs.com/wml-it/p/15585052.html

    2024年02月06日
    浏览(43)
  • git 提交出错:failed error: failed to push some refs to

    git push 时候出错:failed error: failed to push some refs to  这是因为远程和本地版本不一致导致的 解决办法: 1, git pull --rebase origin 分支名称 git pull --rebase 分支名称 :是将远程库中的更新合并到本地库中 rebase参数:取消本地更新内容的commit 并将本地更新接到远程更新合并之后,

    2024年02月08日
    浏览(44)
  • git使用git push -u origin master提交远程仓库时报错error: failed to push some refs to ‘‘https://gitee.com/xx报错解决

            今天使用git将项目提交远程仓库时报错了,报错如下:         error: failed to push some refs to \\\'https://gitee.com/wang-junyanga/qiuy.git\\\'  出现问题前的操作:         我再 gitee 中初始化了一个名字为 Qiuy 的仓库,里面有一个默认的分支为 master,我想要将本地仓库中的名为

    2024年02月16日
    浏览(46)
  • 解决 Git 错误 error: failed to push some refs to ‘https://*****.git‘

      当在 git 上创建好仓库后在上传时出现 ! [rejected] main - main (fetch first) , error: failed to push some refs to ***** 。   我们在创建仓库的时候,都会勾选 添加 README 文件 ,这个操作自动创建了一个 README 文件并配置添加了忽略文件。当点击创建仓库时,系统会自动为我们做一次初

    2024年02月04日
    浏览(38)
  • 软件测试|解决 Git Push 出现 “error: failed to push some refs to“错误

    问题介绍 在使用Git推送代码到远程仓库时,我们可能会遇到以下错误消息之一: 这个错误通常发生在我们尝试将本地分支的更改推送到远程仓库时。这篇文章将详细解释可能导致此错误的原因以及如何解决它。 原因分析 这个错误通常有以下几种原因: 远程仓库的分支比本

    2024年02月08日
    浏览(42)
  • 【问题解决】Git报错:failed to push some refs to xxxxx

    To https://xxxxxxxxxxxx.git ! [rejected] master - master (fetch first) error: failed to push some refs to ‘https://xxxxxxxx.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 hin

    2023年04月15日
    浏览(37)
  • 解决git错误:error: failed to push some refs to ‘git xxx xxxx‘

    友情提醒: 先看文章目录,大致了解文章知识点结构,点击文章目录可直接跳转到文章指定位置。 报错如下: ! [rejected] master - master (non-fast-forward) error: failed to push some refs to \\\'gitxxxxx.test.git\\\' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integ

    2024年01月19日
    浏览(46)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包