简体   繁体   English

停止跟踪git工作目录中存在的已删除文件

[英]stop tracking deleted files present in working directory in git

I have some deleted files in working directory, These are some library files that are missing.我在工作目录中有一些已删除的文件,这些是一些丢失的库文件。 I want git to ignore them.我想让 git 忽略它们。 Adding it to .gitignore would not help as they are already being tracked by git将它添加到 .gitignore 无济于事,因为它们已经被 git 跟踪

For a single file, you can use the following to untract对于单个文件,您可以使用以下方法解压

git rm myfile

In the newer versions of git, those files are automatically untracked with在较新版本的 git 中,这些文件会自动取消跟踪

git add --update

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

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