首页 > 代码库 > .ignore插件自动忽略

.ignore插件自动忽略

AS自带的.ignore文件

在AS中新建项目时,默认会创建一个.ignore文件,其中默认忽略的是
  1. *.iml
  2. .gradle
  3. /local.properties
  4. /.idea/workspace.xml
  5. /.idea/libraries
  6. .DS_Store
  7. /build
  8. /captures
但是用起来不是十分方便,所以再介绍一个自动忽略的插件,并且可以多增加一些忽略的文件

.ignore插件介绍

简介
    .ignore is a plugin for .gitignore (GIT), .hgignore (Mercurial), .npmignore (NPM), .dockerignore (Docker), .chefignore (Chef), .cvsignore (CVS), .bzrignore (Bazaar), .boringignore (Darcs), .mtn-ignore (Monotone), ignore-glob (Fossil), .jshintignore (JSHint), .tfignore (Team Foundation), .p4ignore (Perforce), .flooignore (Floobits), .eslintignore (ESLint), .cfignore (Cloud Foundry), .jpmignore (Jetpack), .stylelintignore (StyleLint) files in your project.

Features
  • Files syntax语法 highlight
  • Coloring着色 ignored files in the Project View(忽略文件在AS中显示为灰色)
  • Gitignore templates模板 filtering过滤 and selecting in rules generator by name and content
  • Show ignored files by specified指定的 ignore file (right click on .gitignore file)
  • Create file in currently selected directory
  • Generate Gitignore rules basing on GitHub‘s templates collection
  • Add selected file/directory to ignore rules from popup menu
  • Suggesting .gitignore file creation for new project
  • Entries inspection (duplicated, covered, unused, relative, incorrect syntax, relative entries) with fix actions
  • Comments and brackets support
  • Navigation to entries in Project view
  • Renaming entries from ignore file
  • Close opened ignored files action
  • Custom user templates with import/export features
  • Create custom templates from existing rules
  • Favorite templates
使用
1、新建
File菜单或工程上右键-->New-->最下面的.ignore file-->选择.gitignore file
技术分享
2、添加忽略文件
上述新建时,或在AS项目中的.gitignore文件上右键时,选择Add template
技术分享
生成
技术分享
3、自动忽略的规则 如下:
  1. ### Android template
  2. # Built application files
  3. *.apk
  4. *.ap_
  5. # Files for the ART/Dalvik VM
  6. *.dex
  7. # Java class files
  8. *.class
  9. # Generated files
  10. bin/
  11. gen/
  12. out/
  13. # Gradle files
  14. .gradle/
  15. build/
  16. # Local configuration file (sdk path, etc)
  17. local.properties
  18. # Proguard folder generated by Eclipse
  19. proguard/
  20. # Log Files
  21. *.log
  22. # Android Studio Navigation editor temp files
  23. .navigation/
  24. # Android Studio captures folder
  25. captures/
  26. # Intellij
  27. *.iml
  28. .idea/workspace.xml
  29. .idea/tasks.xml
  30. .idea/libraries
  31. # Keystore files
  32. *.jks
  33. # External native build folder generated in Android Studio 2.2 and later
  34. .externalNativeBuild
最好先将里面的内容拷出来


来自为知笔记(Wiz)


.ignore插件自动忽略