git - .gitignore stash 在 VSCode 中

标签 git visual-studio-code gitignore

我的 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 the explorer.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/

相关文章:

linux - git推送突然失败(git-remote-https : relocation error)

git - 从 Powershell 下载私有(private) Github 存储库返回 404

python - 无法将 python 代码部署到 heroku

typescript - 转到定义在 VS Code 版本 1.47.2 中不起作用

visual-studio-code - 更改 VS Code 远程 SSH 的路径

git - CtrlP:忽略 git repo 子目录中的文件

git - 为什么 git rm --cached 不删除本地曾经跟踪的文件而是其他文件

git - 致命 : ambiguous argument '<branch_name>' : both revision and filename

c++ - 使用node-gyp异常: LNK2001 unresolved external symbol

linux - Git 忽略并更改历史记录(在 Windows 上)