$ git push -u origin master
To github.com:a653398363/testtest.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:a653398363/testtest.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
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

1、在使用git 对源代码进行push到gitHub时可能会出错

2、出现错误的主要原因是github中的README.md文件不在本地代码目录中

3、可以通过如下命令进行代码合并【注:pull=fetch+merge]

git pull --rebase origin master

4、执行上面代码后可以看到本地代码库中多了README.md文件

5、此时再执行语句 git push 即可完成代码上传到github

如何解决error: failed to push some refs的更多相关文章

  1. git 解决 error: failed to push some refs to 'https://github.com/xxxx.git'

    在github远程创建仓库后, 利用gitbash进行提交本地文件的时候出现如下错误 [root@foundation38 demo]# git push -u origin master Usern ...

  2. github 如何解决error: failed to push some refs

    错误 error: failed to push some refs to 'https://github.com/whitclass/scrapy-spider.git' hint: Updates ...

  3. error: failed to push some refs to 'https://github.com/username/python.git'

    解决error: failed to push some refs to 'https://github.com/bluepen/python.git' 当我们在使用git工具上传我们自己的代码时,可 ...

  4. git rebase与 git合并(error: failed to push some refs to)解决方法

    1.遇到的问题 本地有一个git仓库,在github上新建了一个空的仓库,但是更新了REWADME.md的信息,即在github上多了一个提交. 关联远程仓库,操作顺序如下: git remote a ...

  5. 如何解决git====push 过程中出现的。error: failed to push some refs

    当我们在利用git  push 文件到仓库时出现了一下问题: ! [rejected] master -> master (fetch first)error: failed to push s ...

  6. git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to

    今天对代码进行了修改优化,然后往往远程push,但push后报错了 git操作 git add . git commit -m"fix" git push origin maste ...

  7. 错误:error: failed to push some refs to 'https://github.com/pzq7025/KG.git'的解决办法

    一.问题在进行[git push orgin master]的时候出现如下错误 ! [rejected] master -> master (non-fast-forward) error: f ...

  8. 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 ...

  9. Git本地分支版本号过低导致的push错误 error: failed to push some refs to ... 及兴许amend

    今天在用git的时候遇到了一个问题.在想远程分支push的时候,出现了以下的错误: ! [remote rejected] master -> refs/for/master (change 1 ...

随机推荐

  1. Git 相关使用

    https://www.cnblogs.com/mengdd/p/3447464.html 删除本地 & 远程 的分支.   删除本地分支 命令行 : $ git branch -d < ...

  2. 【原创】go语言学习(十九)测试用例

    目录 单元测试 压力测试 Go test命令介绍 单元测试 1.自动化测试框架 testingA. testing包提供了自动化测试相关的框架B. 支持单元测试和压力测试 import ( “test ...

  3. 遇到bug如何处理

    issue中查询是否有相似bug assert / try-except / IDE单步调式 框架可以查询源码或者查询官方文档

  4. 在取变量名的时候,千万不要用new

    这样子是会报错的

  5. linux的free命令详解-内存是拿来用的不是拿来看的

    $ free -m total used free shared buffers cached Mem: -/+ buffers/cache: Swap: 第一部分Mem行:total 内存总数: 1 ...

  6. sql server 使用SqlBulkCopy批量插入数据库

    sql server sqlbulkcopy 批量数据插入数据库使用的是System.Data.SqlClient中的 SqlBulkCopy批量数据插入数据库 sql server 使用SqlBul ...

  7. 数字图像处理--算术、几何、谐波、逆谐波均值滤波器Matlab

    本文链接:https://blog.csdn.net/Dooonald/article/details/78545461算术均值 close all clear all f=imread('D:/te ...

  8. OpenJudge计算概论-找出第k大的数

    /*================================================ 找出第k大的数 总时间限制: 1000ms 内存限制: 1000kB 描述 用户输入N和K,然后接 ...

  9. SQL-W3School-函数:SQL UCASE() 函数

    ylbtech-SQL-W3School-函数:SQL UCASE() 函数 1.返回顶部 1. UCASE() 函数 UCASE 函数把字段的值转换为大写. SQL UCASE() 语法 SELEC ...

  10. 最新解决Chrome(版本76.0.3809.100) “请停用以开发者模式运行的扩展程序”的方法

    最新解决Chrome(版本76.0.3809.100) “请停用以开发者模式运行的扩展程序”的方法 最近在远景论坛上发现了最新的解决Chrome浏览器提示:请停用以开发者模式运行的扩展程序的问题.该方 ...