问题:
This question already has answers here :
这个问题已经在这里有了答案 :
How to make Git “forget” about a file that was tracked but is now in .gitignore?
如何使Git“忘记”已跟踪但现在位于.gitignore中的文件?
(24 answers)
(24个答案)
Closed 2 years ago .
2年前关闭。
I have an already initialized Git repository that I added a .gitignore
file to. 我有一个已经初始化的Git存储库,向其中添加了一个.gitignore
文件。 How can I refresh the file index so the files I want ignored get ignored? 如何刷新文件索引,以便忽略要忽略的文件?
解决方案:
参考一: https://stackoom.com/question/4mVG/忽略已经提交到Git存储库的文件-重复参考二: https://oldbug.net/q/4mVG/Ignore-files-that-have-already-been-committed-to-a-Git-repository-duplicate
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/3212207