简体   繁体   English

无法使用 Git 存储更改

[英]Can't stash changes with Git

I have changed some files and I want to stash these changes but when I run;我更改了一些文件,我想隐藏这些更改,但是当我运行时;

git stash save "teststash"

from command line, It gives error;从命令行,它给出错误;

Cannot save the current index state

I am using Webstorm and also I cannot stash any changes with it also.我正在使用 Webstorm,而且我也不能用它来隐藏任何更改。 WebStorm gives same error; 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

EDIT:编辑:

git -status

Here is the output of status command;这是状态命令的输出;

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")

git stash save is deprecated as of 2.15.x/2.16.从 2.15.x/2.16 开始,不推荐使用git stash save

You may use git stash push -m "message" where "message" is your note for that stash.您可以使用git stash push -m "message"其中 "message" 是您对该存储的注释。

If you wish to retrieve the stash, first list all the the stashed items and choose the suitable one.如果您想取回藏品,请先列出所有藏品并选择合适的物品。

use git stash list to list out all the stashed items.使用git stash list列出所有隐藏的项目。 And to apply any stashed item git stash apply stash@{<stash_id>}并应用任何隐藏的项目git stash apply stash@{<stash_id>}

Git Stash Document: Git Stash Man Page Git Stash 文档: Git Stash 手册页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM