简体   繁体   English

如何让 git 停止跟踪具有相同扩展名的文件?

[英]How do I make git stop tracking files with the same extension?

I want git to stop tracking the.class files of my folder, I don't really need them to be tracked, I know I can put their names on.gitignore but is there a way to just ignore any future, past and present things that has the.class extension?我想让 git 停止跟踪我文件夹的 .class 文件,我真的不需要跟踪它们,我知道我可以把它们的名字放在 .gitignore 上,但是有没有办法忽略任何未来、过去和现在的事情有 .class 扩展名?

Yes there is!就在这里! Just add this (on a separate line) to your .gitignore :只需将此(在单独的行中)添加到您的.gitignore

*.class

The * serves as a wildcard to match any string (so it could be any file name) *用作匹配任何字符串的通配符(因此它可以是任何文件名)

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

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