Git:代码冲突常见解决方法
来源:互联网 发布:淘宝店网址怎么改 编辑:程序博客网 时间:2024/06/05 21:49
如果系统中有一些配置文件在服务器上做了配置修改,然后后续开发又新添加一些配置项的时候,
在发布这个配置文件的时候,会发生代码冲突:
error: Your local changes to the following files would be overwritten by merge: protected/config/main.phpPlease, commit your changes or stash them before you can merge.
如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:
git stash git pull git stash pop
然后可以使用git diff -w +文件名 来确认代码自动合并的情况.
反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard git pull
其中git reset是针对版本,如果想针对文件回退本地修改,使用git checkout HEAD file/to/restore
本文转载自http://blog.sina.com.cn/s/blog_600e56a60101esqq.html
查看那更多文章请点击进入我的个人博客
0 0
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Git:代码冲突常见解决方法
- Android动画之Frame Animation逐帧动画
- Java正则表达式的学习(一)
- 如何在VC中输出特殊符号
- poi的工具类发现的问题
- kill
- Git:代码冲突常见解决方法
- 【Python语法】Python中为自定义类编写help文档以及进行文档测试
- 使用mvc模式实现用户登录001
- java线程学习一
- 聂树斌案摘肾疑云:谁是替罪羊?
- SQLite使用笔记
- 关于Design包中TabLayout+ViewPager的简单使用
- Composer之命令行
- Xcode中常用的快捷键