【发布时间】:2020-10-13 17:52:49
【问题描述】:
我正在使用 git gui。试图排除一些文件(*.dll、*.pdb - 例如从我的 Unstaged Changes 列表中)。 我有一个 .gitignore 文件 (UTF-8),与 .git 文件夹位于同一文件夹中。 对于测试用例,我正在尝试删除 *.dll 文件(我过去已经提交了这类文件 - 我只是不希望它们出现在 Unstaged Changes 中,在进行新构建之后)。 这是我的 .gitignore 文件内容:
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
#server side
*.dll
*.pdb
*.suo
*.cache
*.ide-wal
*.out
我做错了什么?
【问题讨论】:
-
"我正在尝试删除 *.dll 文件(我以前已经提交过这些文件)" 您知道
.gitignore不会以任何方式帮助您忽略您已经拥有的文件承诺? -
@matt - 是的!我知道 - 我正在尝试在当前提交中删除这些文件
-
这就是
git rm的用途。 -
哇,谢谢 - 错字了!