git报错:failed to push some refs to 'git@github.com:JiangXiaoLiang1988/CustomerHandl
一、错误信息
今天在使用git将代码上传到GitHub的时候报下面的错误:

以前上传代码的时候重来没有出现这种错误,在网上查找了半天终于找到原因了:github中的README.md文件不在本地代码目录中。以前在GitHub上面创建Repository上传代码的时候没有勾选自动创建README.md文件,所以上传的时候直接就上传成功了。这次在创建Repository的时候勾选了自动创建README.md,所以造成本地Repository和远程的Repository代码不一致,上传的时候就出现截图中的错误了。

注意:在GitHub上面创建Repository的时候在下面的位置创建README.md文件,如下图所示:

二、解决办法
可以通过如下命令进行代码合并【注:pull=fetch+merge]
$ git pull --rebase origin master
如下图所示:

执行完上面的代码以后查看本地Repository文件,会发现多了README.md文件:

最后在执行下面的代码上传:
$ git push -u origin master
如图所示:

这时候在上传代码就会成功了。
git报错:failed to push some refs to 'git@github.com:JiangXiaoLiang1988/CustomerHandl的更多相关文章
- git报错failed to push some refs to 'git@github.com:Markprint/github.git'
这个不知名小错误用了我两天的空余时间mmp 就是这里报的错 输入 git push origin master -f 解释为: 远程分支上存在本地分支中不存在的提交,往往是多人协作开发过程中遇到 ...
- git push 报错:failed to push some refs to 'git@git.xxxx:devops/thor.git'
error: failed to push some refs to 'git@git.caicaivip.com:devops/thor.git' hint: Updates were reject ...
- git 提交代码报错failed to push some refs to 解决笔记
Administrator@SC- MINGW64 /e/gitrepository (master) $ git push django master To github.com:zgc137/dj ...
- git 解决 error: failed to push some refs to 'https://github.com/xxxx.git'
在github远程创建仓库后, 利用gitbash进行提交本地文件的时候出现如下错误 [root@foundation38 demo]# git push -u origin master Usern ...
- failed to push some refs to 'git@github.com:RocsSun/mytest.git
Git推送到GitHub仓库失败 使用Git将文件推送至GitHub的远程仓库时,报错failed to push some refs to 'git@github.com:RocsSun/mytes ...
- git 报错:error: failed to push some refs to 'https://github.com/Anderson-An/******.git'(已解决)
提交push 报错: $ git push origin masterTo https://github.com/Anderson-An/******.git ! [rejected] master ...
- git push报错error: failed to push some refs to 'git@github.com'
git push报错error: failed to push some refs to 'git@github.com' $ git push -u origin master To git@git ...
- 由于github仓库中提前建立readme文件,导致git push报错error: failed to push some refs to 'git@github.com:
$ git push -u origin master To git@github.com:xxx/xxx.git ! [rejected] master -> master (fetch fi ...
- git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra
推送本地代码到github报错 git push报错 ! [rejected] master -> master (non-fast-forward) error: failed to push ...
- 解决failed to push some refs to git
Administrator@PC-20150110FGWU /K/cocos2d/yc (master) $ git push -u origin master To git@github.com:y ...
随机推荐
- Flink| 运行架构
1. Flink运行时组件 作业管理器(JobManager) 任务管理器(TaskManager) 资源管理器(ResourceManager) 分发器(Dispatcher) 2. 任务提交流程 ...
- Ubuntu18.04 下最好用的gif录制工具peek
最近在写代码,需要找一个ubuntu下的录制屏幕工具,尝试了几个,发现peek是最好用的.这里就给大家推荐一下. 一 安装: 该软件是一个在gihtub上的开源软件,源码路径: https://git ...
- 阿里钉钉技术分享:企业级IM王者——钉钉在后端架构上的过人之处
本文引用了唐小智发表于InfoQ公众号上的“钉钉企业级IM存储架构创新之道”一文的部分内容,收录时有改动,感谢原作者的无私分享. 1.引言 业界的 IM 产品在功能上同质化较高,而企业级的 IM 产品 ...
- 由异常:Repeated column in mapping for entity/should be mapped with insert="false" update="false 引发对jpa关联的思考
由异常:Repeated column in mapping for entity/should be mapped with insert="false" update=&quo ...
- Exe4j 打包: this executable was created with an evaluation version of exe4j
异常 this executable was created with an evaluation version of exe4j 异常.png 问题原因 当前打包使用exe4j未授权 解决方法 ...
- LeetCode 第70题动态规划算法
导言 看了 动态规划(https://www.cnblogs.com/fivestudy/p/11855853.html)的帖子,觉得写的很好,记录下来. 动态规划问题一直是算法面试当中的重点和难点, ...
- ETCD:多机上的集群
原文地址:cluster on multiple machines 总览 启动一个集群静态的要求是每一个集群中的成员需要知道其他成员的位置.在许多情况下,集群成员的IP可能无法提前知道.在这种情况下, ...
- Cypress 之 环境配置
将项目添加到cypress时,cypress.json会在项目中创建一个文件,此文件用于存储projectId,以及你提供的任何配置项. { "projectId": " ...
- Java入门系列之StringBuilder、StringBuffer(三)
前言 上一节我们讲解了字符串的特性,除了字符串类外,还有两个我们也会经常用到的类,那就是StringBuffer和StringBuilder.因为字符串不可变,所以我们每次对字符串的修改比如通过连接c ...
- [WPF 自定义控件]让Form在加载后自动获得焦点
1. 需求 加载后让第一个输入框或者焦点是个很基本的功能,典型的如"登录"对话框.一般来说"登录"对话框加载后"用户名"应该马上获得焦点,用 ...