刚刚使用 git pull 命令拉取代码时候,遇到了这样的问题:

error: Your local changes to the following files would be overwritten by merge:
code/b2bstore/site/src/main/webapp/pc/src/themes/ac-b2bpc/order/order-confirm.vue
Please commit your changes or stash them before you merge.

  

这是由于远程库中的更改与本地的更改有冲突

git的提示已经非常明确了,告诉我们要么把我们的更新进行commit要么就先stash本地更新。

我是通过这种方式解决的:

   git add.
  git commit -m "订单详情"
  git pull 先拉取代码

  git push 最后提交你写了的代码

  

或者:用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栈。

  

【git冲突解决】: Please commit your changes or stash them before you merge.的更多相关文章

  1. git冲突解决、线上分支合并、luffy项目后台登陆注册页面分析引入

    今日内容概要 git冲突解决 线上分支合并 登陆注册页面(引入) 手机号是否存在接口 腾讯云短信申请 内容详细 1.git冲突解决 1.1 多人在同一分支开发,出现冲突 # 先将前端项目也做上传到 g ...

  2. 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 ...

  3. Git版本控制:Git冲突解决 相关错误总结

    http://blog.csdn.net/pipisorry/article/details/46958699 冲突处理 git push冲突处理 git push时出现冲突:! [rejected] ...

  4. 指定文件夹 指定文件后缀名 删除整个文件夹 git 冲突解决 create a new repository on the command line push an existing repository from the command line

    http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001375840038939c2 ...

  5. git冲突解决的几种办法

    文章目录 git stash 栈 放弃本地修改 撤销分支 强行冲掉之前的分支 删除分支 git stash 栈 git stash git pull git stash pop 当pull出现冲突时 ...

  6. Please commit your changes or stash them before you merge问题解决

    问题描述 error: Your local changes to the following files would be overwritten by merge: xxx/xxx/xxx.c P ...

  7. git冲突解决

    http://www.cnblogs.com/sinojelly/archive/2011/08/07/2130172.html http://hi.baidu.com/jqxw4444/item/f ...

  8. git 冲突解决(转载)

    gerrit是不会解决冲突的,如果两个人同时改了一个文件的同一行,就会冲突,你将会看到Review in Progress并且最下面会有Your change could not be merged ...

  9. git 冲突解决办法

    1. Pull is not possible because you have unmerged files. 症状:pull的时候 $ git pull Pull is not possible ...

随机推荐

  1. 使用wordpress搭建的一个微信小程序

  2. springboot中图标的定制

    因为我用的版本是org.springframework.boot spring-boot-starter-parent 2.3.3.RELEASE 第一种方法: 配置一个application.yml ...

  3. Redis 部署方式(单点、master/slaver、sentinel、cluster) 概念与区别

    转载自 https://blog.csdn.net/java_zyq/article/details/83818341 在K8S上部署Redis集群时突然遇到一个(sentinel哨兵模式)概念,感觉 ...

  4. javascript操作多选下拉列表

    闲来无事,把javascript操作多选下拉列表有关的操作知识复习了一遍,代码附上 <%-- Created by IntelliJ IDEA. User: Administrator Date ...

  5. FTP服务器稳定性测试

    FTP服务器稳定性探讨,如何部署FTP服务在server2003上,可能广大网友们有其他的选择,我选择的是Filezilla server.毕竟他是开源又免费 在架构师的悉心指导下,对FTP有了个更深 ...

  6. MySQL必知必会(1-12章)

    第一章:了解SQL 数据库基础:(概念) 数据库软件: DBMS(数据库管理系统) 数据库: 通过DBMS创建和操纵的容器: 保存有组织的数据的容器-->通常是一个文件或者一组文件: 表: 某种 ...

  7. DVWA SQL-injection 附python脚本

    SQL-Injection low等级 首先我们将dvwa等级调到low 如图 接下来选择SQL Injection,并在提交框中输入正常值1,查看返回结果 接下来检测是否存在注入,分别输入 1' a ...

  8. Spring Boot 系统启动任务定义

    前言 系统任务:在项目启动阶段要做一些数据初始化操作,这些操作有一个共同的特点,只在项目启动时进行,以后都不再执行. 应用场景:例如配置文件加载,数据库初始化等操作 Spring Boot出现之前 解 ...

  9. spring源码之bean的初始化及循环引用

    实例化方法,把bean实例化,并且包装成BeanWrapper 1.点进这个方法里面. 这个方法是反射调用类中的 factoryMethod 方法. 这要知道@Bean 方法的原理, 实际上sprin ...

  10. Python-判断变量类型和继承链-type isinstance

    在很多情况下,需要对类型进程动态判断,因为不同的数据类型不能互相做运算并且各自拥有不同的运算逻辑,所有需要判断对象的类型,常用的是type和isinstance,type更过用于获取对象是什么类型构建 ...