今天想把最近的一些小代码push到github上

我先是将该目录git init进行初始化,然后

git add -A ,

接着

git commit -m “description...”

然后在github上新建一个远程库,想要将其与我本地的库相关联,使用:

git remote add origin git@github.com:YOURGITHUBNAME/REPOSITORY.git

并push到远程端

至此,一切顺利

于是,我使用了命令:

git push -u origin master

结果报错如下:

error: failed to push some refs to 'git@github.com:你的远程库名.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

从提示可以看出,是由于两者不同步,因此需要先pull,进行合并然后在进行push,

因此先使用

git pull --rebase origin master

将远程文件同步下来。

然后再执行推送

git push -u origin master

git push failed to push some refs to xxxx 失败与解决方法相关推荐

  1. Git Your branch is ahead of ‘origin/master‘ by X commits解决方法

    Git Your branch is ahead of 'origin/master' by X commits解决方法 参考文章: (1)Git Your branch is ahead of 'o ...

  2. .NET Core SDK在Windows系统安装后出现Failed to load the hostfxr.dll等问题的解决方法

    .NET Core SDK在Windows系统安装后出现Failed to load the hostfxr.dll等问题的解决方法 参考文章: (1).NET Core SDK在Windows系统安 ...

  3. SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.的解决方法

    文章目录 前言 解决办法 前言 最近在研究如何用java更方便更简洁的去进行HTTP请求,过去我一直用的是jdk自带的HttpURLConnection ,国庆正好有时间研究研究其他大佬推荐的Http ...

  4. git冲突failed to push some refs to 'git@github.com:解决

    状态 linux和windows系统都作为一个git远程仓库的本地仓库,linux那边push了修改,windows这边没有pull最新的修改就直接在项目中进行修改,想要push windows的修改 ...

  5. git push 失败与解决方法

    今天想把最近的一些小代码push到github上 我先是将该目录git init进行初始化,然后 git add -A , 接着 git commit -m "description...& ...

  6. linux git 401,git push 提示 401 Unauthorized while accessing https 的原因及解决方法

    引言 昨天开始重新学习Git的基础知识,很久时间不用了,就容易忘记. 错误提示 当执行git push命令时,提示"401 Unauthorized while accessing http ...

  7. 对于在git上面拉代码报“error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054“解决方法

    对于在git上面拉代码报"error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054"解 ...

  8. Git使用出现Automatic merge failed; fix conflicts and then commit the result.解决方法

    Git使用出现Automatic merge failed; fix conflicts and then commit the result.解决方法 参考文章: (1)Git使用出现Automat ...

  9. 问题排查--@cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken解决方法

    @cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken解决 作者用的是ID ...

最新文章

  1. spring-boot学习资料
  2. linux中科大yum源,CentOS:国内常用的yum源
  3. [BZOJ 1112] [POI2008] 砖块Klo 【区间K大】
  4. ORB-SLAM(四)追踪
  5. Codeforces 1196B Odd Sum Segments
  6. 有n个人围成一圈,按顺序从1到n编号。从第一个人开始报数
  7. css 获取第一个a标签,CSS-伪类获取除第一个之外的其他子元素
  8. 【C++】字符串替换问题
  9. Altium Designer 09简易教程(一)
  10. 五种MATLAB画圆方式程序
  11. 计算机二级access无忧考吧破解,无忧考吧access模拟考试软件
  12. mysql mtq_MySQL调优学习笔记(一、MySQL基础)
  13. JS基础--强制类型转换(易错点,自用)
  14. 基于亚像素的边缘检测方法
  15. 第118篇 在区块链浏览器上调用合约
  16. Windows系统中npm install时遇到npm WARN checkPermissions Missing write access to问题
  17. 如何查看谷歌浏览器中保存的密码
  18. 【强化学习】DDPG(Deep Deterministic Policy Gradient)算法详解
  19. SQL Server中出现用户或角色在当前数据库已经存在的问题的解决
  20. pandorabox mysql_GitHub - gy-games/pandorabox: 基于非对称加密(RSA)的私密信息传递工具,数据由本地客户端进行加密、解密操作。...

热门文章

  1. HoloLens初入——研究模式
  2. HoloLens2开发
  3. 吉林教育杂志吉林教育杂志社吉林教育编辑部2022年第18期目录
  4. “包”治百病,BOS丰富的预付费资源包来了
  5. 世界顶级机器学习科学家黄恒加入京东,出任京东大数据首席科学家
  6. CPU不同字母的意思
  7. vue 、前端rsa加密遇到的问题,message too long for RSA
  8. MySQL报错:Data too long for column
  9. SpringMVC 学谈 (第三章)
  10. mysql的用户名迁移SCHEMA_数据库实时转移之Confluent环境搭建(二)