zoukankan      html  css  js  c++  java
  • 提交冲突解决

    一、将本地文件修改后push到远程分支有时会出现  devlops|MERGING

    git add .
    
    git commit -m "feat:优惠券功能"
    
    git pull
    
    ........... (devlops|MEARGE)
    
    git add .
    
    git commit -m "feat:优惠券"
    
    git push
    

    二、push的时候出现rejected

    $ git push -u origin branchName
    
    To https://gitlab.hangjia.online/changqing/vue-node.git
     ! [rejected]        case -> case (non-fast-forward)
    error: failed to push some refs to 'https://gitlab.hangjia.online/changqing/vue-node.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. # 可以尝试强制push
    $ git push -u origin branchName -f

      

     三、本地分支拉去远程分支 pull 的时候会出现  fatal:refusing to merge unrelated histories

    // 克隆远程分支
    
    git clone https:(ssh)..........
    
    // 创建并切换分支
    
    git checkout  BranchName
    
    // 拉去远程分支 到本地
    
    git pull
    
    fatal: refusing to merge unrelated histories
    
    // 出现fatal 由于远程仓库 认为是两个不相干的仓库,相当于远程merge到本地 则需要强制下来
    
    git pull origin BranchName  --allow-unrelated-histories
    
    // 出现如下 有冲突,修改次文件
    CONFLICT (add/add): Merge conflict in README.md
    
    git add .
    
    git commit -m "commit"
    
    git pull
    
    // 此时分支所有文件下拉完成 如果修改的 修改后即可 push
    

      

  • 相关阅读:
    【转载】如何学JavaScript?前辈的经验之谈
    javascript基础学习心得01
    CSS之浮动
    HTML5基础学习心得
    如何使用HTML5的canvas属性
    HTML标记语言
    HTML+CSS学习
    线性表
    (2)协程之 greenlet模块
    (1)协程之理论
  • 原文地址:https://www.cnblogs.com/hongzhuang/p/13395972.html
Copyright © 2011-2022 走看看