我的 VSCode (Insiders) 几天前 stash 了 .gitignore
,我无法恢复它,我尝试了很多搜索,但添加的解决方案:
{
...
"files.exclude": {
"**/.gitignore": false
},
...
}
在 settings.json 中不起作用,在带有 UI 的设置中我只有:
.svn
.hg
CVS
.DS_Store
Thumbs.db
.git
文件夹没有被 stash ,.vscode
或其他以 .
开头的文件也没有被 stash ,只有 .gitignore
.
我正在使用 VSCode Insiders 1.69.0-insider
,提交 4c72dedb4ad283a569f83a7389468c3ae2c742c3
。
最佳答案
这可能是因为 vscode/issue
152891已修复:
set
"explorer.excludeGitIgnore": "true"
意思是 excludeGitIgnore
现在正在 insider 中工作。
这在 issue 152543 中讨论:
Looks like a recent change means
.gitignore
now always gets hidden in Explorer unless you have set"explorer.excludeGitIgnore": true
, in which case the.gitignore
file shows but none of the.gitignored
files do.I saw that even having a folder without Git initialized in it still results in the
.gitignore
being hidden.
Seems like it's a default behavior and theexplorer.excludeGitIgnore
setting changes this behavior.I tried messing with the
Files: Exclude
setting and adding a negated glob (or whatever that's officially called) to get the gitignore back, but that didn't work.
现在应该修复了。
关于git - .gitignore stash 在 VSCode 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72753152/