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,这样就可以这样解决冲突的工程文件啦。如图所示:

     

  • 相关阅读:
    java--接口和抽象类
    java-访问权限
    Appium点击掉弹窗的方法小记
    Appium报错及解决小记
    adb获取手机设备蓝牙&热点&wifi状态并操作的笔记
    Linux下安装appium环境搭建杂记
    Appium的使用笔记(自动化测试前的分析)
    Docker学习笔记
    python学习杂记-DDT驱动测试
    python学习杂记-处理CSV文件
  • 原文地址:https://www.cnblogs.com/Jordandan/p/4742198.html
Copyright © 2011-2022 走看看