在Git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件的方法 ,把要忽略的文件名填进去,Git就会自动忽略这些文件。 很多人都知道提交项目到GitHub上都需要忽略一些文件,但是估计有些人不知道GitHub已经为我们准备了各种编程语言的配置文件了。今天就是普及这个简单的知识点 。虽然简单,但是非常有用 。 https://github.com/github/gitignore 
Android.gitignore # Built application files *.apk *.ap_
# Files for the ART/Dalvik VM *.dex
# Java class files *.class
# Generated files bin/ gen/ out/
# 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/dictionaries .idea/libraries
# Keystore files # Uncomment the following line if you do not want to check your keystore files in. #*.jks
# 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 以斜杠“/”开头表示目录; 以星号“*”通配多个字符; 以问号“?”通配单个字符 以方括号“[]”包含单个字符的匹配列表; 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录; 注意:.ignore 配置文件是按行从上到下进行规则匹配的,前面的规则已经匹配到的,则后面的规则将不会生效。
|