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 文件!且仓库文件不受影响!建议使用

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

    一份帮助文档,无论多么仔细,都不会帮助主人多敲一行代码!
  • 相关阅读:
    滚动条美化插件 nicescroll
    百度地图api
    Echarts的重点
    3月20号课堂随笔
    循环for语句
    有关一些CSS的基本内容
    HTML基本标签和一些注释的问题
    2018年3月17号的随堂笔记
    03.15补习
    for 的相关用法
  • 原文地址:https://www.cnblogs.com/yaogengzhu/p/9866759.html
Copyright © 2011-2022 走看看