博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Git merge 冲突时解决方式
阅读量:6847 次
发布时间:2019-06-26

本文共 3369 字,大约阅读时间需要 11 分钟。

hot3.png

//创建本地分支 制造冲突Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2$ git clone git@github.com:ZhuBaker/learngit.git .Cloning into '.'...remote: Counting objects: 32, done.remote: Compressing objects: 100% (20/20), done.remote: Total 32 (delta 3), reused 30 (delta 1), pack-reused 0Receiving objects: 100% (32/32), done.Resolving deltas: 100% (3/3), done.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git checkout -b featureSwitched to a new branch 'feature'Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ lsabc.txt  dd  ddd.txt  READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git commit -m 'feature'[feature 62feb86] feature 1 file changed, 1 insertion(+)//切换到 master分支Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git checkout masterSwitched to branch 'master'Your branch is up-to-date with 'origin/master'.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git commit -m 'master'[master a1d0ee6] master 1 file changed, 1 insertion(+)//开始合并代码Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git merge featureAuto-merging READMYFILECONFLICT (content): Merge conflict in READMYFILEAutomatic merge failed; fix conflicts and then commit the result.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git statusOn branch masterYour branch is ahead of 'origin/master' by 1 commit.  (use "git push" to publish your local commits)You have unmerged paths.  (fix conflicts and run "git commit")  (use "git merge --abort" to abort the merge)Unmerged paths:  (use "git add 
..." to mark resolution) both modified: READMYFILEno changes added to commit (use "git add" and/or "git commit -a")Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ cat READMYFILEadd by masterfeature<<<<<<< HEADFFFF=======DDDD>>>>>>> featureAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git commit -m 'merge'[master d2ac9a9] merge//测试已经合并成功Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git merge featureAlready up-to-date.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git pushCounting objects: 9, done.Delta compression using up to 4 threads.Compressing objects: 100% (6/6), done.Writing objects: 100% (9/9), 926 bytes | 0 bytes/s, done.Total 9 (delta 0), reused 0 (delta 0)To github.com:ZhuBaker/learngit.git 2360738..d2ac9a9 master -> master//删除本地临时分支Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git branch -d featureDeleted branch feature (was 62feb86).

 

转载于:https://my.oschina.net/LucasZhu/blog/1550866

你可能感兴趣的文章
ActiveMq+spring jms+MQ主备
查看>>
面向对象学习(4):抽象的意义
查看>>
使用MvcHandler设计自定义系统权限<下>
查看>>
AgileEAS.NET平台开发实例-智能升级及服务器部署
查看>>
关于ARP的一些理解
查看>>
Word打开后出现乱码
查看>>
MPLS-BGP-××× ISP- IS-IS Cient- EIGRP and OSPF
查看>>
Linux 基础习题
查看>>
Docker run命令使用
查看>>
ssh连接远程主机执行脚本的环境变量问题
查看>>
我的友情链接
查看>>
图片格式和大小,多用CSS和JS,不用大图片
查看>>
java_vuser脚本编写httppost方式发送stream进行接口测试
查看>>
记账王进行期末调汇的教程
查看>>
三层路由器的好文章
查看>>
python监控进程内存
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
Dancer--introduction小议❷
查看>>
floyd算法c++
查看>>