zoukankan      html  css  js  c++  java
  • Git中的merge命令实现中出现问题及其解决

    Git中的merge命令实现和工作方式

    2015年8月17日星期一

    丹丹

    git代码在合并两个分支的时候总是会出现一下的错误提示,不能正常的完成合并分支,错误提示如图所示:

     

    但是在其他的终端是可以完成合并任务的,所以是本地iMac的环境问题,推测原因一:.ignore文件的问题,推测原因二:是Xcode的问题。

    针对可能原因二:

    链接:

    http://stackoverflow.com/questions/14605231/git-merge-branch-into-master

    按照参考文件在终端进行操作,但是仍旧会有这样的错误提示:

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git checkout master

    M homezxb-3.8.0/homezxb.xcodeproj/project.xcworkspace/xcuserdata/qiaodandan.xcuserdatad/UserInterfaceState.xcuserstate

    Already on 'master'

    Your branch is up-to-date with 'origin/master'.

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git merge Branch1104

    Updating 995534b..abd7343

    error: Your local changes to the following files would be overwritten by merge:

    homezxb-3.8.0/homezxb.xcodeproj/project.xcworkspace/xcuserdata/qiaodandan.xcuserdatad/UserInterfaceState.xcuserstate

    Please, commit your changes or stash them before you can merge.

    Aborting

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git commit -m "提交"

    On branch master

    Your branch is up-to-date with 'origin/master'.

    Changes not staged for commit:

        modified:   homezxb-3.8.0/homezxb.xcodeproj/project.xcworkspace/xcuserdata/qiaodandan.xcuserdatad/UserInterfaceState.xcuserstate

     

    no changes added to commit

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git push

    ssh: connect to host 192.168.221.11 port 22: Operation timed out

    fatal: Could not read from remote repository.

     

    Please make sure you have the correct access rights

    and the repository exists.

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git push

    Everything up-to-date

    QiaoDandandeiMac:teamworkTwo qiaodandan$ git merge Branch1104

    Updating 995534b..abd7343

    error: Your local changes to the following files would be overwritten by merge:

    homezxb-3.8.0/homezxb.xcodeproj/project.xcworkspace/xcuserdata/qiaodandan.xcuserdatad/UserInterfaceState.xcuserstate

    Please, commit your changes or stash them before you can merge.

    Aborting

    QiaoDandandeiMac:teamworkTwo qiaodandan$

    如何解决???

    在终端出现的问题,在sourceTree中完美解决,发生冲突之后,在sourceTree中去选项目文件即可完成合并代码,并且成功提交代码。体现了sourceTree和终端的完美结合,解决步骤:

    在sourceTree中拖拽好本地文件之后,就配置好了sourceTree,这样就可以这样解决冲突的工程文件啦。如图所示:

     

  • 相关阅读:
    zabbix 配置发送邮件报警
    sql server 修改表结构语法大全
    SQL Server日期与字符串之间的转换
    Convert.ToDateTime(值),方法可以把一个值转化成DateTime类型。
    Oracle trunc()函数的用法
    Oracle job procedure 存储过程定时任务
    向数据库中插入一个DateTime类型的数据到一个Date类型的字段中,需要转换类型。TO_DATE('{0}','YYYY-MM-DD'))
    逗号分隔的字符串转换为行数据(collection)(续)
    Oracle中INSTR、SUBSTR和NVL的用法
    oracle中substr() instr() 用法
  • 原文地址:https://www.cnblogs.com/Jordandan/p/4742198.html
Copyright © 2011-2022 走看看