Android 使用git 忽略文件
生活随笔
收集整理的這篇文章主要介紹了
Android 使用git 忽略文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
git 使用的是.ignore 忽略文件的 下面是github上面的android 使用的忽略文件修改了部分
可以直接復制到項目中使用 ,如果有特殊的添加即可
# Built application files
*.apk# Files for the ART/Dalvik VM
*.dex# Java class files
*.class# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# 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/
# .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
.cxx/# 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/
?.gitignore?的格式規范
1 所有空行或者以?#?開頭的行都會被 Git 忽略
2?匹配模式可以以(/)開頭防止遞歸
3?匹配模式可以以(/)結尾指定目錄
4?要忽略指定模式以外的文件或目錄,可以在模式前加上嘆號(!)取反
*.apk? 是忽略所有的.apk 文件
/build? ?是忽略根目錄下的build文件 ,假如其他目錄有build?不會被忽略
build/? 是 忽略任何目錄下的build?文件
如果剛開始項目沒有添加忽略文件,遠程倉庫里面已經有了要忽略的文件了
在.ignore 里面添加了忽略文件在提交文件的時候記得 刪除本地緩存
git rm -rf --cached . 然后在add 在 commit 在push ,不刪除緩存的話,可能導致忽略沒有效果
?
?
?
總結
以上是生活随笔為你收集整理的Android 使用git 忽略文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android EditText 修改光
- 下一篇: 导游证挂靠导游协会,如果不交会费有什么后