http://blog.csdn.net/llf369477769/article/details/51917557

按照网上教程用git把项目上传到github,但是在最后一步git push origin master时出现了以下错误。

$ git push origin master
To github.com:frankliy/h5.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:frankliy/h5.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.

后来查了一些资料,最后用最简单粗暴的方式,强制覆盖已有分支(可能会丢失改动)。执行以下命令,最后上传成功。

git push -u origin master -f

git push origin master 上传失败的更多相关文章

  1. git push origin master出错:error: failed to push some refs to

    1.输入git push origin master 出错:error: failed to push some refs to 那是因为本地没有update到最新版本的项目(git上有README. ...

  2. git push origin master和git push有什么区别?

    1.master是主分支,还可以建一些其他的分支用于开发.2.git push origin master的意思就是上传本地当前分支代码到master分支.git push是上传本地所有分支代码到远程 ...

  3. git push origin master、git pull出现如下错误

    git push origin master出现如下错误: Counting objects: , done. Writing objects: % (/), bytes, done. Total ( ...

  4. git push origin master:master

    $git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为mast ...

  5. git push origin master错误

    以下错误是因为远程有的文件,本地没有,故而无法push文件到远程 $ git push origin master To git@github.com:AntonioSu/learngitWindow ...

  6. git push -u origin master 上传出错问题

    ============================================ 跟着廖学锋教程初学git发现个很奇怪的问题,后面原来发现是这样,有点逗.. ================= ...

  7. git push origin master 报错 remote rejected] master -> master (branch is currently checked out)

    解决办法: 977down vote You can simply convert your remote repository to bare repository (there is no wor ...

  8. git push origin master 错误解决办法

    一.错误代码如下: error: failed to push some refs to 'https://github.com/wbingithub/drag.git' 二.在网上搜了一下,如下写就 ...

  9. 解决Git - git push origin master 报错

    关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 欢迎大家关注我的微信公众号:「醉翁猫咪」 原因:github仓库中没有README.md文件 解决如下: 重新输入git push ...

随机推荐

  1. JS全选反选功能

    总选框:<input type="checkbox" class="all" name="all"> 子选框: <inpu ...

  2. 我对MVC的理解

    1.    MVC :M模型  V视图  C控制器 1.1  模型是用来处理业务逻辑的,里面由许多类构成 1.2  视图是用来显示界面的 1.3  控制器是一个中间人,它通过视图的提交方式(post, ...

  3. linux 系统管理11 ——系统安全及应用

    一.基本安全措施 1.系统账号清理 (1).将非登陆用户的shell设为/sbin/nologin 方法一.usermod -s 方法二.chsh命令,交互式修改 方法三.chsh -s usermo ...

  4. python 练习1(流控制)

    #!/usr/bin/python #_*_ coding:utf-8 _*_ #练习题 #1.使用while循环输入 1 2 3 4 5 6 8 9 10 #a.定义一个变量存放数字 #b.用whi ...

  5. JSON 是个什么??!!!

    json就是字符串! json就是字符串! json就是字符串! 重要的事情说三遍!json本质就是字符串,经过序列化的字符串.json的出现只是方便传输.你可以将所有的数据类型用序列化函数序列化js ...

  6. zookeeper注册与发现

    pom.xml添加如下引用: <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId ...

  7. 使用python连接mysql/oracle

    最近python比较火,我本身觉得python这种语言速度也不快,做项目也一般,学他干啥?但是了解到python把其他语言的函数封装成了自己的包,用python就可以直接调用,感觉python还是值得 ...

  8. spring里的事物设置

    有的人说事物在spring里设置有两种,其实事物设置在spring配置文件中共有五种方式:第一种方式:每个Bean都有一个代理第二种方式:所有Bean共享一个代理基类第三种方式:使用拦截器第四种方式: ...

  9. ava新手入门详细介绍

    Java总有它的千般好处使你选择它,但这些随便翻翻书或在网上逛一圈就能找到答案.在本文中,笔者把自己学习Java的一些切身体会和过程写出来,供初学者做个参考. 我在学习Java的过程中主要围绕以下几个 ...

  10. Keepalived配置文件详解

    global_defs { router_id LVS_$prio #节点唯一标识,通常为hostname } local_address_group laddr_g1 { ${lvs_node} # ...