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,这样就可以这样解决冲突的工程文件啦。如图所示:
Git中的merge命令实现中出现问题及其解决的更多相关文章
- Git中的merge命令实现和工作方式
想象一下有例如以下情形:代码库中存在两个分支,而且每一个分支都进行了改动.最后你想要将当中的一个分支合并到其它的分支中.个人博客网址 http://swinghu.github.com/ 那么要问合并 ...
- mysql中如何在命令行中,执行一个SQL脚本文件?
需求描述: 在mysql数据库的使用中,有的时候,需要直接在shell的命令行中,执行某个SQL脚本文件, 比如,要初始化数据库,创建特定的存储过程,创建表等操作,这里进行一个基本的测试. 一般情况, ...
- git can't merge 的处理 代码冲突问题的解决
***取回已经提交的代码 git reset HEAD^ git can't merge 的处理1.git status 确保status 为空,可以先提交2.git reset HEAD^ 取 ...
- linux中没有tree命令,command not found,解决办法
在有网络的情况下: 1.包管理器安装 centos 中用 yum -y install tree ubuntu 中用 apt-get install tree 当然如果需要权限不要忘了在前面加上 ...
- 【转】Linux中history历史命令使用方法详解
原文网址:http://os.51cto.com/art/201205/335040.htm 当你在玩Linux的时候,如果你经常使用命令行来控制你的Linux系统,那么有效地使用命令历史机制将会使效 ...
- Linux中history历史命令使用方法详解
当你在玩Linux的时候,如果你经常使用命令行来控制你的Linux系统,那么有效地使用命令历史机制将会使效率获得极大提升.事实上,一旦你掌 握了我在下面给出的15个有关Linux history历史命 ...
- pycharm中可以运行的程序,在命令行中运行提示模块不存在的问题
运行模块(包含main函数的模块),在模块开头添加以下代码,原因是pycharm运行python脚本时,会自动添加以下代码,将当前库加入到系统库目录集合中,在命令行中运行需要手动添加import os ...
- Git知识总览(五) Git中的merge、rebase、cherry-pick以及交互式rebase
上篇博客聊了<git分支管理之rebase 以及 cherry-pick相关操作>本篇博客我们就以Learning Git中的关卡进行展开.下方列举了LearningGit中的 merge ...
- Git 日常工作中使用的命令记录
前言 这篇文章主要是介绍我在使用Git中的有一些忘记了,但是很重要的命令. 20190424 Git 历史信息 username 和 email 更改 git config alias.chang ...
随机推荐
- Shell错误[: missing `]'
shell 文件运行时出现错误: [: missing `]' 原因可能是 if [ ! -d $date] then mkdir ./$date fi 代码中的 ] 方括号内部必须要有个空格 ...
- FZU 1627 Revival's road
矩阵快速幂. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inc ...
- Webpack入门——使用Webpack打包Angular项目的一个例子
2016.1.22,对大多数人来说,这是一个非常平常的日子,但这却是我决定在博客园写博客的日子.虽然注册博客园的博客已有4年8个月,却一直没有动手写过一篇博客,原因是觉得自己水平不行,写不出好东西,所 ...
- 13.hibernate的native sql查询(转自xiaoluo501395377)
hibernate的native sql查询 在我们的hibernate中,除了我们常用的HQL查询以外,还非常好的支持了原生的SQL查询,那么我们既然使用了hibernate,为什么不都采用hi ...
- CABasicAnimation 几种停止的回调
一.编写一个简单的动画,使一个UIview从屏幕的左上角移动到左下角,间隔时间3S // // ViewController.m // CAAnimationTest // // Created by ...
- jQuery 学习小结
1,jQuery是一个简单的JavaScript库,提供了一系列辅助函数:以下简称jq; 使用jq时,通常将jq代码放到head部分的事件处理方法中,也可以将其单独写出 .js 文件,引入:但无论哪种 ...
- pc app 桌面打包
进入 http://nwjs.io/ 下载 创建web项目,在项目根目录 创建文件package.json并填写 1 2 3 4 5 6 7 { "name": " ...
- python-连接数据库
from sqlalchemy import create_engine,text,Column,Integer,String,Sequencefrom sqlalchemy.ext.declarat ...
- 【python问题系列--3】TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
p0V,p1V,pSpam=trainNBO(array[trainMat],array(trainClasses)) 改为: p0V,p1V,pSpam=trainNBO(array(trainMa ...
- 10个男孩和n个女孩共买了n2+8n+2本书,已知他们每人买的书本的数量是相同的,且女孩人数多于南海人数,问女孩人数是多少?(整除原理1.1.3)
10个男孩和n个女孩共买了n2+8n+2本书,已知他们每人买的书本的数量是相同的,且女孩人数多于南海人数,问女孩人数是多少? 解: 因为,每个人买的书本的数量是相同的, 所以,10|n2+8n+2 所 ...