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

     

  • 相关阅读:
    176. Second Highest Salary
    175. Combine Two Tables
    172. Factorial Trailing Zeroes
    171. Excel Sheet Column Number
    169. Majority Element
    168. Excel Sheet Column Title
    167. Two Sum II
    160. Intersection of Two Linked Lists
    个人博客记录
    <meta>标签
  • 原文地址:https://www.cnblogs.com/Jordandan/p/4742198.html
Copyright © 2011-2022 走看看