美文网首页Git
Git stash pop error

Git stash pop error

作者: JaedenKil | 来源:发表于2019-01-23 13:25 被阅读10次

When do git stash pop, a possible error is: Your local changes to the following files would be overwritten by merge.

$ git stash pop
error: Your local changes to the following files would be overwritten by merge:
        src/store.js
Please commit your changes or stash them before you merge.
Aborting
The stash entry is kept in case you need it again. 

Possibly you have uncommitted work in the file store.js, or there will be conflict in the file after git stash pop.
A solution is:

git add src/store.js
git stash pop

Then modify the conflict in store.js, do git add src/store.js, git commit -m "xxx", problem solved.

git stash

pop [--index] [-q|--quiet] [<stash>]
Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse operation of git stash push. The working directory must match the index.

Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call git stash drop manually afterwards.

If the --index option is used, then tries to reinstate not only the working tree’s changes, but also the index’s ones. However, this can fail, when you have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally).

When no <stash> is given, stash@{0} is assumed, otherwise <stash> must be a reference of the form stash@{<revision>}.


apply [--index] [-q|--quiet] [<stash>]
Like pop, but do not remove the state from the stash list. Unlike pop, <stash> may be any commit that looks like a commit created by stash push or stash create.

相关文章

  • Git stash pop error

    When do git stash pop, a possible error is: Your local ch...

  • 找回pop掉的stash

    git stash pop,不同于git stash apply, 会应用且pop出最近的一次stash,stas...

  • git 缓存的常用方法

    git 缓存的常用方法 git stash2.git stash pop3.git stash list4.git...

  • git merge时遇到error:Your local cha

    执行下面三步,再执行git merge git stash git pull git stash pop

  • git stash 多单

    git stash 一单 git stash pop 就可以拿出这一单 git stash 多单 git stas...

  • GIT的使用

    教程地址 查看状态 git status 暂存 git stash 恢复暂存 git stash pop 更...

  • git命令行 解决冲突的方法

    git stash 先把你的更改暂存到本地,git pull下来别人的代码git stash pop stash把...

  • Git

    git stash和git stash pop git stash 可用来暂存当前正在进行的工作, 比如想pull...

  • stash相关

    1,git stash 保存当前工作区到git stack 2, git stash pop [ id]恢复最近或...

  • git stash

    git stashgit stash pop(最新的暂存) 如果不想使用最新的暂存,可以 git stash li...

网友评论

    本文标题:Git stash pop error

    本文链接:https://www.haomeiwen.com/subject/wkpjjqtx.html