今天用git pull来更新代码,遇到了下面的问题:

qrh$ git pull -a
Updating bebc9d4..32e538a
error: Your local changes to the following files would be overwritten by merge:
    test_qiyi/bin/classes.dex
    test_qiyi/bin/resources.ap_
    test_qiyi/bin/test_qiyi.apk
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

Git commit your changes or stash them before you can merge相关推荐

  1. Git冲突:commit your changes or stash them before you can merge.

    今天用git pull来更新代码,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...

  2. Git pull时报错:commit your changes or stash them before you can merge. 的解决办法

    Git pull时报错:commit your changes or stash them before you can merge. 的解决办法 今天在pull的时候,报错,信息如下: error: ...

  3. commit your changes or stash them before you can merge 解决方法

    在git提交过程中,commit your changes or stash them before you can merge 是一个常见的问题(如下图). 问题:在你merge or change ...

  4. commit your changes or stash them before you can merge

    今天用git pull来更新代码,遇到了下面的问题: 今天git pull 出现以下问题 Please commit your changes or stash them before you mer ...

  5. Git更新本地冲突:commit your changes or stash them before you can merge。。。

    从git仓库pull源码到本地时,提示本地冲突错误 英文阅读水平还ok,通过万能的有道翻译如下:"错误:您对以下文件的本地更改将被合并覆盖,请在你可以合并之前,提交你的修改或者隐藏它们&qu ...

  6. Please, commit your changes or stash them before you can merge.

    在你pull的时候发现pull失败,因为本地有修改,所以有两种解决方式: 1. 将修改暂存,保留修改 git stash //暂存当前正在进行的工作. git pull //拉取服务器的代码 git ...

  7. 使用TortoiseGit pull时,提示Please, commit your changes or stash them before you can merge.

    这是代码冲突导致的. 解决:点击项目 右键选择 stash save(把自己的代码隐藏存起来) -> 重新pull -> stash pop(把存起来的隐藏的代码取回来 ) -> 代 ...

  8. Git冲突:Please commit your changes or stash them before you merge

    当执行 git pull 命令时,提示错误如下: Updating bb954c5..02de6f1 error: Your local changes to the following files ...

  9. git commit使用其他人的用户名和邮箱提交代码

    git commit --author= git commit --author="aaa aaa@www.com" aaa :表示其他人的用户名 aaa@www.com :表示其 ...

最新文章

  1. excel导入SQL脚本
  2. Linux预备知识(二):进程空间地划分-用户空间/内核空间
  3. 汇编语言--寄存器(cpu工作原理)
  4. 【RecyclerView】 十二、RecyclerView 数据更新 ( 修改单条数据 | 批量修改数据 )
  5. How is CRM status filtering logic done
  6. c++ primer练习题 第七章 类 (Class)
  7. 使用ASP.NET MVC3+EF+Jquery制作文字直播系统(四)——完成篇
  8. [转载]MySQL各类SQL语句的加锁机制
  9. iOS 更新日志 - 持续更新中
  10. 新闻发布系统 新闻管理系统 可注册、登录
  11. [linux kernel] 内核下RX8025对接系统时钟
  12. 关于win10自动更新无法关闭
  13. python tokenize()_Python tokenize-rt包_程序模块 - PyPI - Python中文网
  14. python如何拼读英语单词怎么写_浅谈如何拼读英语新单词
  15. 安装Adobe软件时显示:您的浏览器或者操作系统不再受支持,您可能需要安装操作系统的最新更新。---部分软件解决方案(只支持Adobe Creative Cloud包括的软件)
  16. 5G/NR 为什么RRC新增RRC_INACTIVE态?
  17. 鸿蒙电脑操作系统最新消息,今日大事件:鸿蒙操作系统6月2日见苹果 WWDC 将于 6 月 8 日举行...
  18. 将镜像源更换成阿里云的镜像源
  19. [小说]魔王冢(楔子)
  20. Fackbook涉嫌点击欺诈,最多达100%

热门文章

  1. php的验证码要gd库,PHP利用GD库实现一个简单的验证码
  2. notes系统服务器地址,notes怎么连接服务器地址
  3. as常用固定搭配_英语考试干货!205个常用介词固定搭配
  4. vue可视化拖拽组件模板_基于 Vue 丝滑般拖拽排序组件VueSlicksort
  5. HttpApplication类及派生的Global类
  6. 一个对象,数组去重的方法
  7. gitlab在centons环境下的安装及使用
  8. css3中的 @Keyframes
  9. Copy List with Random Pointer
  10. sqlite学习笔记5:插入数据,查询数据和删除数据