zoukankan      html  css  js  c++  java
  • git pull远程项目识别的

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

    在码云新建了一个项目后生成有readme.md文件在push本地项目是出现一下错误

    $ git push gitee master
    To gitee.com:wei_1/Tess4JDemo.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'git@gitee.com:wei_1/Tess4JDemo.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.

    原来是需要先合并远程master分支,于是执行pull命令

    $ git pull gitee master
    warning: no common commits
    remote: Enumerating objects: 4, done.
    remote: Counting objects: 100% (4/4), done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 4 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (4/4), done.
    From gitee.com:wei_1/Tess4JDemo
     * branch            master     -> FETCH_HEAD
     * [new branch]      master     -> gitee/master
    fatal: refusing to merge unrelated histories

    使用一下命令可以,上面连接上的为什么我没看太懂。。

    The full syntax is:
    
    git pull --rebase origin master
    git push origin master
    That way, you would replay (the --rebase part) your local commits on top of the newly updated origin/master (or origin/yourBranch: git pull origin yourBranch).

    使用git pull --rebase origin master即可

  • 相关阅读:
    zzuli---1912---小火山的爱情密码
    zzuli---1907---
    zzuli---1899---985的最大和难题
    zzuli---1898---985的数字难题
    Light oj ---1058---poj---1971---Parallelogram Counting
    UVA---10200
    poj---1064---Cable master
    hdu---5423---Rikka with Tree
    fzu---2128
    Bookshelf 2 01背包
  • 原文地址:https://www.cnblogs.com/wei1/p/9582044.html
Copyright © 2011-2022 走看看