zoukankan      html  css  js  c++  java
  • git问题--Push rejected: Push to origin/master was rejected

    解决git问题

    Push rejected: Push to origin/master was rejected

    意思是git拒绝合并两个不相干的东西 
    此时你需要在打开Git Bash,然后进入相应的目录,然后敲git命令

    $ git pull origin master --allow-unrelated-histories

    出现类似于这种信息就说明pull成功了:

    $ git pull origin master --allow-unrelated-histories
    From https://github.com/yanghaopeng/python_utils
     * branch            master     -> FETCH_HEAD
    Merge made by the 'recursive' strategy.
     utils/hello.py | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
     1 file changed, 323 insertions(+), 31 deletions(-)

    将本地仓库中的推送到github中,使用如下的git命令:

    $ git push -u origin master

    完了,去刷新github,就可以看到东西已经推送成功 

  • 相关阅读:
    看代码写程序
    NP
    一道神题
    找平方数
    凝视
    排队打水
    时间计算
    git客户端下载地址
    iOS GCD
    UIView 和 CALayer的那点事
  • 原文地址:https://www.cnblogs.com/xiao-apple36/p/9097527.html
Copyright © 2011-2022 走看看