zoukankan      html  css  js  c++  java
  • push to origin/master was rejected错误解决方案

    push to origin/master was rejected错误解决方案

    原因

    初始化项目时,远程仓库自动建了某些文件,而本地仓库与远程仓库尚没有进行文件关联,因此需要将两个仓库的文件进行关联后提交。

    操作步骤

    切换到自己项目所在的目录

    1.右键选择GIT BASH Here,Idea中可使用Alt+F12

    2.在terminl窗口中依次输入命令:

    git pull

    git pull origin master

    git pull origin master --allow-unrelated-histories

    $ git pull
    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), pack-reused 0
    Unpacking objects: 100% (4/4), done.
    From gitee.com:courage129/mybatis
     * [new branch]      master     -> origin/master
    There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.
    
        git pull <remote> <branch>
    
    If you wish to set tracking information for this branch you can do so with:
    
        git branch --set-upstream-to=origin/<branch> master
    
    
    $ git pull origin master
    From gitee.com:courage129/mybatis
     * branch            master     -> FETCH_HEAD
    fatal: refusing to merge unrelated histories
    
    $ git pull origin master --allow-unrelated-histories
    From gitee.com:courage129/mybatis
     * branch            master     -> FETCH_HEAD
    error: Your local changes to the following files would be overwritten by merge:
      .idea/compiler.xml .idea/encodings.xml .idea/inspectionProfiles/Project_Default.xml .idea/misc.xml .idea/workspace.xml Mybatis.iml
    
    
    

    3.在idea中重新push自己的项目,成功!!

  • 相关阅读:
    ASP.NET验证控件的使用 拓荒者
    读书笔记:MFC单文档应用程序结构分析 拓荒者
    MFC单文档(SDI)全屏程序的实现 拓荒者
    jQuery的animate函数
    设备尺寸杂谈:响应性Web设计中的尺寸问题
    Yeoman学习与实践笔记
    IE对文档的解析模式及兼容性问题
    推荐给开发和设计人员的iPad应用
    几个移动应用统计平台
    颜色、网页颜色与网页安全色
  • 原文地址:https://www.cnblogs.com/Courage129/p/14088721.html
Copyright © 2011-2022 走看看