git pull 更新错误解决办法
2015-10-14 15:23
399 查看
Your local changes to the following files would be overwritten by mergeerror: 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.参考http://blog.csdn.net/zwhfyy/article/details/8625228如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:git stashgit pullgit stash pop然后可以使用git diff -w +文件名 来确认代码自动合并的情况.反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:git reset --hardgit pull其中git reset是针对版本,如果想针对文件回退本地修改,使用untracked working tree file参考:http://blog.csdn.net/sheismylife/article/details/7204345编写脚本自动编译并部署时的注意如果想在C2上编写脚本自动从S1上获取最新代码时,要注意:1.首先之前产生的公钥不能设密码,否则每次git pull的时候都会要求输入密码。2.不要将项目中的编译中间文件提交到S1上,比如CMake工程里面的build目录的文件,Maven工程里面的target目录里面的文件。否则下次在C2等客户端用git pull会报类似于这样的错误:error: Untracked working tree file 'public/images/icon.gif' would be overwritten by merge.需要执行下面的命令才能修复:git reset --hard HEADgit clean -f -dgit pull
相关文章推荐
- 2014找工作总结-机会往往留给有准备的人
- 如何查看MyEclipse包含的Eclipse的版本号,用于装插件选择插件版本
- 黑马程序员————java反射的简单应用
- Android初学习 - onActivityResult和setResult方法的使用
- <LeetCode><Easy>263 Ugly Number (因式分解)
- vim的块选择
- ubuntu14.04 更新源
- easyui datagrid组件应用
- iptables 相关名词的解释说明
- crontab -e
- Android四大组件之Service解析
- 如何查看 linux 内核源代码
- ALAssetsGroup
- POJ 1065 Wooden Sticks 贪心
- Java常用的接口、类、方法
- 《UNIX网络编程》读书笔记1---简介和TCP/IP
- 图解测试之稳定性-设计测试场景
- Unity中的Path对应各平台中的Path
- 观察者模式
- CodeChef 2015年10月问题