Git冲突:commit your changes or stash them before you can merge.
2015-09-17 10:19
489 查看
Git冲突:commit your changes or stash them before you can merge.今天用git pull来更新代码,遇到了下面的问题:[html] viewplaincopyerror: Your local changes to the following files would be overwritten by merge: xxx/xxx/xxx.java Please, commit your changes or stash them before you can merge. Aborting 提示已经很友好了,从网友处得到的答案直接帮我解决问题。1.stash通常遇到这个问题,你可以直接commit你的修改;但我这次不想这样。看看git stash是如何做的。
git stash git pull git stash pop接下来diff一下此文件看看自动合并的情况,并作出相应修改。git stash: 备份当前的工作区的内容,从最近的一次提交中读取相关内容,让工作区保证和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。git stash pop: 从Git栈中读取最近一次保存的内容,恢复工作区的相关内容。由于可能存在多个Stash的内容,所以用栈来管理,pop会从最近的一个stash中读取内容并恢复。git stash list: 显示Git栈内的所有备份,可以利用这个列表来决定从那个地方恢复。git stash clear: 清空Git栈。此时使用gitg等图形化工具会发现,原来stash的哪些节点都消失了。2.放弃本地修改,直接覆盖之
git reset --hard git pull
相关文章推荐
- ios 推送证书没有密钥 解决方案【转载】
- Redhat Ext4 File System Guide
- JDBC中的Dao设计模式
- windows Server 2008各版本有何区别?
- 机器学习--监督学习(二)
- PHP教程实例:adodb配置与使用
- 学习笔记:Node.js(一)
- 在MAC上查找和设置$JAVA_HOME
- Displaying SharePoint Lists or Libraries in other sites 显示其他站点的List
- “.网络”域名总量TOP12:排名无变化 新网夺冠
- 13星座性格购买iphone6s的搞笑反映
- hdu 5017 模拟退火求最值
- web前端面试题
- Android各大网络请求库的比较及实战
- Android 实现系统深度休眠笔记
- 2015-09-17 001 日志与对话框公用类_public
- iOS 取相册
- jQuery Mobile
- Redhat Linux 6 Ext3 File System Guide
- Bug:编译链接,发现找不到符号,用nm工具查看,发现符号属性有两个分别是U和T