zoukankan      html  css  js  c++  java
  • git常见错误处理

    状态不一致:Your branch is ahead of 'origin/master' by 2 commits

    git push origin master

    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to 'http://*.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 merge the remote changes (e.g.,
    hint: 'git pull') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    现象:当查看状态时,或者pull拉取server上的版本时,提示本地commit没有push:

    # 查看本地状态信息 git status

    报错

    On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits)

    【分析】:

    如果保证git server上确实已经提交了代码,仅仅只是本地git状态不一致,则可以用以下命令:

    git fetch - -all git pull git reset - -hard origin/master



  • 相关阅读:
    fescar中文官网
    mybatis 中的 update 返回值你真的明白吗
    数据库读写分离搭建
    git 回退各种场景操作
    听说noip2015有幻方
    noi2015的回忆和教训
    bzoj4026
    bzoj4127
    bzoj2119
    关于fft的一点总结
  • 原文地址:https://www.cnblogs.com/songyuejie/p/14122062.html
Copyright © 2011-2022 走看看