git报错:error: Your local changes to the following files would be overwritten by checkout:
原因
原本想切换到dev分支,拉取远程dev分支,但我将分支上的数据修改了,此时切换分支报错
解决方案
方法一: 存到暂存区
# 暂存
git add .
git stash
之后切换分支到dev,执行git pull,切换回原分支,获取之前修改的文件,使用如下命令
// 取出的时候使用
git stash pop
方法二:发起一个commit 存到提交历史
git add .
git commit -m "commit message"
不太建议的方案
以下两种方案我没有尝试过,但是忽视错误,在开发中时不可取的行为,所以不建议使用
方法一:删除修改
git clean -n //这个是清除文件预览
git clean -f //强制清除文件
方法二:强制切换
git checkout -f <branch> // <branch>为要切换到的分支名,注意不带“<>”
git报错:error: Your local changes to the following files would be overwritten by checkout:的更多相关文章
- git文件冲突合并的报错:Your local changes to the following files would be overwritten by merge
记录一下在项目里使用git遇到代码冲突时的解决方法 问题:当我和我同事两个人改了相同的一个文件,他在我提交前提交了,这时候我就提交不了了,并且也pull不下来他的代码 会报错: Your local ...
- error: Your local changes to the following files would be overwritten by checkout:
在发布这个配置文件的时候,会发生代码冲突: error: Your local changes to the following files would be overwritten by merge ...
- git error: Your local changes to the following files would be overwritten by merge:xxxxxx ,Please commit your changes or stash them before you merge.的phpstorm解决办法
git报错 error: Your local changes to the following files would be overwritten by merge: .idea/encoding ...
- Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). Git fet ...
- 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). 2017年02 ...
- git:Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). 解决办法一:保 ...
- Git版本控制工具使用:Error pulling origin: error: Your local changes to the following files would be overwritten by merge
摘自: CSDN 逆觞 git在pull时,出现这种错误的时候,可能很多人进进行stash,相关stash的请看:Error pulling origin: error: Your local cha ...
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
在使用git pull拉取服务器最新版本时,如果出现error: Your local changes to the following files would be overwritten by m ...
- 解决 error: Your local changes to the following files would be overwritten by merge:XXXX
版权声明:这可是本菇凉辛辛苦苦原创的,转载请记得带上我家地址,不要忘记了哈 ... https://blog.csdn.net/u011314442/article/details/78852547 ...
- 解决error: Your local changes to the following files would be overwritten by merge
在项目里我们一般都会把自己第一次提交的配置文件忽略本地跟踪 1 [Sun@webserver2 demo]$ git update-index --assume-unchanged <filen ...
随机推荐
- [UR #14]人类补完计划
计数好题. 题意:给定简单无向图 \(G=(V,E),|V|=n,|E|=m\),有 \(n\leq 16,m\leq {n\choose 2}\),求所有为基环树的子图的权值之和.一个基环树的权值定 ...
- PM系统成本科目挂接教程-如何查手册和看帮助文档
如果这么简单的问题都无法入门只能说回炉重造吧孩子. ---by SheZQ 正文 成本科目挂接作为PM系统最基本的取数依据,数据汇总的根本,是必须要会的技能.如果没有挂接,就会出现空值或者0值. 摘自 ...
- 【Python基础】 什么是函数
函数是一段可重用的代码块,它接受输入参数并返回输出.函数在程序设计中具有很多优点,如: 代码重用:在程序中可以重复调用相同的代码块,使程序更加简洁.高效. 模块化设计:函数是模块化设计的基本单元,可以 ...
- CST为什么要关闭 GPU 卡的 ECC 模式而开启 TCC 模式?操作使用【详解】
在使用CST软件之前,我们一般建议大家关闭 GPU 卡的 ECC 模式而开启 TCC 模式.那么,为什么要进行这样一个操作呢?在此之前,给大家科普一下什么是"ECC"和" ...
- 2023-05-24:为什么要使用Redis做缓存?
2023-05-24:为什么要使用Redis做缓存? 答案2023-05-24: 缓存的好处 买啤酒和喝啤酒的例子可以帮助我们理解缓存的好处. 假设你在超市里买了一箱啤酒,如果你需要每次想喝啤酒就去超 ...
- golang 包管理
- javaer你还在手写分表分库?来看看这个框架怎么做的 干货满满
java orm框架easy-query分库分表之分表 高并发三驾马车:分库分表.MQ.缓存.今天给大家带来的就是分库分表的干货解决方案,哪怕你不用我的框架也可以从中听到不一样的结局方案和实现. 一款 ...
- ConcurrentHashMap是如何实现的?
众所周知 ConcurrentHashMap 是 HashMap 的多线程版本,HashMap 在并发操作时会有各种问题,比如死循环问题.数据覆盖等问题.而这些问题,只要使用 ConcurrentHa ...
- qq飞车端游最全按键指法教学
目录 起步篇 超级起步 弹射起步 段位起步 基础篇 点飘 撞墙漂移 撞墙点喷 进阶篇 双喷 叠喷 断位漂移 段位双喷 侧身漂移 快速出弯 CW WCW CWW 牵引 甩尾点飘 甩尾漂移 右侧卡 左侧卡 ...
- 【Java学习】 Spring的基础理解 IOC、AOP以及事务
一.简介 官网: https://spring.io/projects/spring-framework#overview 官方下载工具: https://repo.spring.io ...