zoukankan      html  css  js  c++  java
  • 【转】Git 冲突:Your local changes would be overwritten by merge. Commit, stash or revert them to proceed.

    解决方案有三种:

    1,无视,直接commit自己的代码。

    git commit -m "your msg"

    2,stash

        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的哪些节点都消失了。

    3,硬覆盖:放弃本地修改,直接用git上的代码覆盖本地代码:

    git reset --hard
    git pull


    补充在 android studio 中的上述操作对应的图:

    方法 2 stash:

     

    方法 3 硬覆盖:

     

    然后选择



  • 相关阅读:
    jquery点滴总结
    优雅降级和渐进增强的区别
    editplus 常用
    whm 设置共享IP
    php抓取页面的几种方法详解
    上传数据插件 Easy Populate 遇到问题 ?langer=remove
    zencart里常用 SQL
    5个简单的步骤把 WordPress 打造成 CMS
    基于PHP的cURL快速入门
    常用软件、插件名称
  • 原文地址:https://www.cnblogs.com/blogofzxf/p/12365649.html
Copyright © 2011-2022 走看看