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 ...
随机推荐
- 设置phpMyAdmin本地自动登陆
一般配置本地测试用的 phpMyAdmin 可以不用每次输入帐号密码,打开后自动登陆就行了. 版本: phpMyAdmin 3.5.3 打开: phpMyAdmin 根目录 复制: config.sa ...
- scala 数组 基本类型
变量尽量用valvar 是不可变 final 常用的 Int̵ Double̵ Long̵ String没有基本类型.scala 任何对象都继承Any Int Double 继承AnyVal Stri ...
- Bullcow 牡牛和牝牛(bzoj 3398)
Description 约翰要带N(1≤N≤100000)只牛去参加集会里的展示活动,这些牛可以是牡牛,也可以是牝牛.牛们要站成一排.但是牡牛是好斗的,为了避免牡牛闹出乱子,约翰决定任意两只牡 ...
- TESTNG重试、截屏、监听
http://qa.blog.163.com/blog/static/19014700220138585422735/
- js-字符串函数
js字符串函数 JS自带函数concat将两个或多个字符的文本组合起来,返回一个新的字符串.var a = "hello";var b = ",world";v ...
- 基于Bootstrap的炫酷jQuery slider插件
简要教程 这是一款在原生bootstrap slider的基础上制作效果非常炫酷的jQuery slider插件.该slider插件可以自定义slider的颜色.形状.透明度和tooltip等属性,美 ...
- HDU 1695 GCD#容斥原理
http://acm.hdu.edu.cn/showproblem.php?pid=1695 翻译题目:给五个数a,b,c,d,k,其中恒a=c=1,x∈[a,b],y∈[c,d],求有多少组(x,y ...
- git三个区域详解
一.可以将git简单的分为三个区域 1.工作区(working directory) 2.暂缓区(stage index) 3.历史记录区(history) 二.三个区域关系:工作区 ...
- IOS 类的属性修饰符atomic
在声明一个类的属性时,默认这个属性会被修饰atomic,意思是原子性访问的. nonatomic和atomic修饰的属性,在自己没有重写setter和getter的时候才会发生作用,其主要的作用可以理 ...
- webapi中的Route的标签的命名参数name的使用
Route Names In Web API, every route has a name. Route names are useful for generating links, so that ...