AndroidStudio插件.ignore过滤不想提交的文件

Project 使用插件,过滤项目不想提交的文件

1.添加插件 .ignore

在这里插入图片描述
插件添加完毕,需要重启,才可以生效。

2. 过滤文件的位置如下图

在这里插入图片描述

3. 使用插件添加过滤文件

在这里插入图片描述

选中项目右键~,如图操作

在这里插入图片描述
我选择了如图选项,随即在项目的 .gitignore 文件内会自动添加相应内容。

### Android template
# Built application files
*.apk
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/


最后,make project ,项目文件就会根据 .gitignore 文件 ,进行更新了。
需要第一次提交的内容、需要第二次提交的内容、不需提交的内容,如图3中颜色显示。

在这里插入图片描述

SVN 和 GIT 一样,都适用

Moudle

build/
*.iml