刚刚使用 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. [LeetCode]438. 找到字符串中所有字母异位词、76. 最小覆盖子串(滑动窗口解决子串问题系列)

    题目438. 找到字符串中所有字母异位词 给定一个字符串 s 和一个非空字符串 p,找到 s 中所有是 p 的字母异位词的子串,返回这些子串的起始索引. 说明: 字母异位词指字母相同,但排列不同的字符 ...

  2. VirtualBox中安装的CentOS开启SSH并设置访问外网

    1.全局设置NAT网络 打开VirtualBox->管理->全局设定 网络->添加按钮->添加一个NAT网络(使用默认的就行,不用改动) 2.设置用来本机于VirtualBox ...

  3. Linux常用命令详解(2)

    aliasunaliasunamesuhostnamehistorywhichwcwwhowhoamipingkillseqdudffreedate 命令详解 1. alias 设置.’查看别名 实例 ...

  4. maven使用心得

    1.一个项目下创建module,需要在project的pom下加入module,这个工程的pom <?xml version="1.0" encoding="UTF ...

  5. SpringBoot 配置的加载

    SpringBoot 配置的加载 SpringBoot配置及环境变量的加载提供许多便利的方式,接下来一起来学习一下吧! 本章内容的源码按实战过程采用小步提交,可以按提交的节点一步一步来学习,仓库地址: ...

  6. python爬取新浪财经

    我们来获取这里的title和url然后再获取这里面url的编辑作者 可以看到右边的几个就对应的左边不同的div .m-p1-mb2-list.m-list-container ul li a impo ...

  7. ansible-doc到底有多好用,助你玩转各种模块

    #使用ansible-doc:查看各种模块的帮助 #命令格式: ansible-doc -l #列出所有的模块列表 ansible-doc -s 模块名 #查看指定模块的参数 ansible-doc ...

  8. Java Web学习(五)session、cookie、token

    文章更新时间:2020/09/14 一.引言 动态网页兴起后,会话管理变成开发者需要考虑的一个问题,由于HTTP请求是无状态的,为了区分每个用户,此时引入了会话标识(sessionId)的概念,但是存 ...

  9. python3-day5

    模块,用一砣代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才 ...

  10. 使用AOP和Validator技术对项目接口中的参数进行非空等校验

    javax.validation.Validator基础知识补充: validator用来校验注解的生效,如: @NotBlank(message = "地址名不能为空") pri ...