zoukankan      html  css  js  c++  java
  • 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 some refs to 'https://github.com/Operater9/guest'
    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.

    查了资料后发现是本地没有update到最新版本的项目(git上有README.md文件没下载下来)

    本地直接push所以会出错。

    执行下面的拉命令,还是不行

    $ git pull origin master
    From https://github.com/Operater9/guest
     * branch            master     -> FETCH_HEAD
    fatal: refusing to merge unrelated histories

    执行下面代码

    参考https://stackoverflow.com/questions/24114676/git-error-failed-to-push-some-refs-to

    git pull --rebase origin master

    发现此时已经把github上最新的文件下载下来了:也就是README.md文件。

    接着执行推送

    git push -u origin master

    成功推送本地代码到远程仓库

    参考https://blog.csdn.net/u013120247/article/details/53263169

  • 相关阅读:
    VS快捷键
    IIS部署WCF
    WLAN的优点
    局域网与WAN比较
    局域网拓扑结构
    局域网协议
    局域网介绍
    wifi主要特性
    wifi发展前景
    Wi-Fi与WAPI主要区别
  • 原文地址:https://www.cnblogs.com/z-x-y/p/11291148.html
Copyright © 2011-2022 走看看