zoukankan      html  css  js  c++  java
  • 如何解决git====push 过程中出现的。error: failed to push some refs

    当我们在利用git  push 文件到仓库时出现了一下问题:

    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:yaogengzhu/ajax.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  -f  //git仓库地址   master    (但是经过的测试 ,这个办法好像会覆盖掉仓库的文件!谨慎使用!

    2.方法二:a)可以通过如下命令进行代码合并  git  pull --rebase //仓库地址  master      

         b) 然后 通过 git  push  //仓库地址  master         (办法可以成功的push 文件!且仓库文件不受影响!建议使用

    目前我掌握就这两个方法~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    一份帮助文档,无论多么仔细,都不会帮助主人多敲一行代码!
  • 相关阅读:
    命令行下的curl使用详解
    升级python版本(从2.4.3到2.6.5)
    vim设置
    php中curl模拟post提交多维数组
    vim折叠设置
    基础算法4——归并排序
    总线类型
    主板分类
    网卡 接口类型
    基础算法3——直接选择排序和堆排序
  • 原文地址:https://www.cnblogs.com/yaogengzhu/p/9866759.html
Copyright © 2011-2022 走看看