无法使用Git进行更改

时间:2019-05-21 12:30:47

标签: git webstorm

我已经更改了一些文件,但是我想隐藏这些更改,但是当我运行时;

git stash save "teststash"

从命令行,它给出错误;

Cannot save the current index state

我正在使用Webstorm,也无法对其进行任何更改。 WebStorm给出相同的错误;

tried to save uncommitted changes in stash before merge, but failed with an error. 
Couldn't stash file://C:/Projects/myproject: Cannot save the current index state

编辑:

git -status

这是状态命令的输出;

On branch branch111
Your branch is up to date with 'origin/branch666'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   package-lock.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    sh.exe.stackdump

no changes added to commit (use "git add" and/or "git commit -a")

1 个答案:

答案 0 :(得分:3)

从2.15.x / 2.16开始不推荐使用

git stash save

您可以使用git stash push -m "message",其中“消息”是该存储的注释。

如果要检索存储,请首先列出所有存储的物品,然后选择合适的物品

git satsh list将列出所有隐藏物品。并应用任何隐藏的项目git stash apply stash@{<stash_id>}

Git隐藏文件:Git Stash Man Page