为什么我的.gitignore文件不忽略特定文件?
我需要忽略任何以.metadata /开头的文件。
我创建了一个git文件(.gitignore):Git忽略文件
我在忽略文件中添加了以下文本: .metadata/.*
但是我的文件似乎仍以红色显示文件:
± |master ↑8 U:44 ?:22 ✗| → git status
On branch master
Your branch is ahead of 'origin/master' by 8 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .metadata/.log
modified: .metadata/.mylyn/.tasks.xml.zip
modified: .metadata/.mylyn/tasks.xml.zip
modified: .metadata/.plugins/com.genuitec.eclipse.devstyle/recent.json
modified: .metadata/.plugins/com.genuitec.eclipse.monitor/myeclipse-usage.properties
要忽略元数据文件夹,请使用**/metadata/*
。(确保您使用git的1.8.2版或更高版本)
另外,您输错了.gitignore
。(将文件名从更改,gitignore
为.gitignore
)
您也可以检出此生成器-> gitignore.io
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句