git push failed to push some refs to xxxx 失败与解决方法
今天想把最近的一些小代码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 失败与解决方法相关推荐
- 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 ...
- .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系统安 ...
- SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.的解决方法
文章目录 前言 解决办法 前言 最近在研究如何用java更方便更简洁的去进行HTTP请求,过去我一直用的是jdk自带的HttpURLConnection ,国庆正好有时间研究研究其他大佬推荐的Http ...
- git冲突failed to push some refs to 'git@github.com:解决
状态 linux和windows系统都作为一个git远程仓库的本地仓库,linux那边push了修改,windows这边没有pull最新的修改就直接在项目中进行修改,想要push windows的修改 ...
- git push 失败与解决方法
今天想把最近的一些小代码push到github上 我先是将该目录git init进行初始化,然后 git add -A , 接着 git commit -m "description...& ...
- linux git 401,git push 提示 401 Unauthorized while accessing https 的原因及解决方法
引言 昨天开始重新学习Git的基础知识,很久时间不用了,就容易忘记. 错误提示 当执行git push命令时,提示"401 Unauthorized while accessing http ...
- 对于在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"解 ...
- 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 ...
- 问题排查--@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 ...
最新文章
- spring-boot学习资料
- linux中科大yum源,CentOS:国内常用的yum源
- [BZOJ 1112] [POI2008] 砖块Klo 【区间K大】
- ORB-SLAM(四)追踪
- Codeforces 1196B Odd Sum Segments
- 有n个人围成一圈,按顺序从1到n编号。从第一个人开始报数
- css 获取第一个a标签,CSS-伪类获取除第一个之外的其他子元素
- 【C++】字符串替换问题
- Altium Designer 09简易教程(一)
- 五种MATLAB画圆方式程序
- 计算机二级access无忧考吧破解,无忧考吧access模拟考试软件
- mysql mtq_MySQL调优学习笔记(一、MySQL基础)
- JS基础--强制类型转换(易错点,自用)
- 基于亚像素的边缘检测方法
- 第118篇 在区块链浏览器上调用合约
- Windows系统中npm install时遇到npm WARN checkPermissions Missing write access to问题
- 如何查看谷歌浏览器中保存的密码
- 【强化学习】DDPG(Deep Deterministic Policy Gradient)算法详解
- SQL Server中出现用户或角色在当前数据库已经存在的问题的解决
- pandorabox mysql_GitHub - gy-games/pandorabox: 基于非对称加密(RSA)的私密信息传递工具,数据由本地客户端进行加密、解密操作。...