Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重新安装windows后git隐藏不起作用_Windows_Git_Github - Fatal编程技术网

重新安装windows后git隐藏不起作用

重新安装windows后git隐藏不起作用,windows,git,github,Windows,Git,Github,我最近重新安装了windows。现在,在我的任何github存储库上执行git stash时,将返回一条错误消息: $ git stash Cannot save the current worktree state 这就是我得到的一切。尝试git-vstash没有任何帮助,因为stash似乎没有详细模式。没有隐藏其他更改,只有一个修改过的文件: $git stash list $git status On branch master Changes not staged for commit

我最近重新安装了windows。现在,在我的任何github存储库上执行
git stash
时,将返回一条错误消息:

$ git stash
Cannot save the current worktree state
这就是我得到的一切。尝试
git-vstash
没有任何帮助,因为
stash
似乎没有详细模式。没有隐藏其他更改,只有一个修改过的文件:

$git stash list
$git status
On branch master
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:   storage.h

no changes added to commit (use "git add" and/or "git commit -a")
$git隐藏列表
$git状态
论分行行长
未为提交而暂存的更改:
(使用“git add…”更新将提交的内容)
(使用“git签出--…”放弃工作目录中的更改)
修改:storage.h
未向提交添加任何更改(使用“git add”和/或“git commit-a”)
我确保在我的全局配置中将
user.name
user.email
设置为与之前相同的值,并使用
git log
git config user.name
git config user.email
进行确认


我能做些什么来缓解这个问题?

我今天遇到了这个问题。我使用的是Windows1064位操作系统,我的Git是64bit。您可能还会看到在当前工作目录中创建了sh.exe.stackdump文件

对我有效的解决方案是:


我不得不从中卸载64位Git并安装32位Git

由于
git stash
实际上是一个脚本,您可以尝试使用脚本调试标志(
-x
)运行它,并观察运行的低级“管道命令”。其中之一是意外失败。找到哪一个,并找出原因,可能会提供信息。@torek好主意!如何在windows上执行此操作?尝试运行
bash-x git stash
将启动WSL安装。虽然可以运行
bash-x
,但只需编辑脚本以添加
-x
设置-x
(如果
git
前端设置了一些东西,那么它确实会设置:-)可能会更容易。脚本的位置由
git--exec path
给出;脚本位于该目录下,名为
git stash
@torek好的,我成功地实现了,pastebin是。我注意到的一件事是,在调用
rm-f[…]
之前调用了
exit 1
,因此
.git
文件夹中充满了文件。好的,因此,根据输出,看起来
rm-f
正在以失败状态退出,尽管它显然成功了;或者bash本身在脚本第140行左右的嵌套的
$(…)
构造上搞砸了(它在非补丁模式下写出了工作树)。特别是工作树确实被写下来了;哈希ID显示在变量
w_树的赋值中。(我不确定下一步该尝试什么,尽管这显然是退出
rm
或者与子shell嵌套有关。)