$ 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. P4092 [HEOI2016/TJOI2016]树

    题目描述 在2016年,佳媛姐姐刚刚学习了树,非常开心.现在他想解决这样一个问题:给定一颗有根树(根为1),有以下两种操作: 标记操作:对某个结点打上标记(在最开始,只有结点1有标记,其他结点均无标记 ...

  2. epoll反应堆模型代码

    libevent函数库核心思想 /*** epoll_loop.c ***/ #include<stdio.h> #include<sys/epoll.h> #include& ...

  3. centos6安装Python3环境

    Python3安装 CentOS 6+系统默认安装的python版本是2.6.6,python2版本与python3还有有一些语法上的不一样.我们要把python升级到3版本,但是系统自带的旧版本py ...

  4. Scrapy不同的item指定不同的Pipeline

    scrapy不同的item指定不同的Pipeline from items import AspiderItem, BspiderItem, CspiderItem class myspiderPip ...

  5. Telegraf+Influxdb+Grafana(Windows下本机简易监控系统搭建)

    1.文件名称 telegraf-1.5.0_windows_amd64.zip influxdb-1.4.2_windows_amd64.zip grafana-4.6.3.windows-x64.z ...

  6. Main property in package.json defines package entry point

    I know my project's dependencies are installed under node_modules directory. But when I do require(' ...

  7. 使用Flask构建机器学习模型API

    1. Python环境设置和Flask基础 使用"Anaconda"创建一个虚拟环境.如果你需要在Python中创建你的工作流程,并将依赖项分离出来,或者共享环境设置," ...

  8. PyTorch Tutorials 3 Neural Networks

    %matplotlib inline Neural Networks 使用torch.nn包来构建神经网络. 上一讲已经讲过了autograd,nn包依赖autograd包来定义模型并求导. 一个nn ...

  9. C# 多线程Thread.IsBackground=True的作用

    C#中多线程的线程加.IsBackground = true与不加有什么区别? 按照MSDN上讲:“获取或设置一个值,该值指示某个线程是否为后台线程.” 其实这个解释并不到位,至少应该解释一下后台线程 ...

  10. 总结解决 Android-Studio 编译耗时(好久、太长)问题

    首先通过搜索有关Android-Studio 编译耗时(好久.太长)问题的博客,速度确实有所改善. 一.暂时解决 Android-Studio 编译耗时(好久.太长)问题 本文链接:https://b ...