Android(安卓)Studio的.gitignore以及gitignore无效的解决
16lz
2022-03-12
github上.gitignore模板合集,里面有各种.gitignore :https://github.com/github/gitignore
自己用的Android Studio下项目的.gitignore文件,对github上的android.gitignore添加了
# OSX files //mac os下
.DS_Store
# Android Studio
*.iml
.idea
# Built application files*.apk*.ap_# Files for the Dalvik VM*.dex# Java class files*.class# Generated filesbin/gen/# Local configuration file (sdk path, etc)local.properties# OSX files.DS_Store# Android Studio*.iml.idea# Gradle files.gradle/build/# Local configuration file (sdk path, etc)local.properties# Proguard folder generated by Eclipseproguard/# Log Files*.log
有时我们发现添加.gitignore文件后并没有忽略我们想要忽略的文件,解决方法就是清除一下缓存,原因gitignore对已经追踪(track)的文件无效,清除缓存后文件将以未追踪的形式出现.然后再重新添加提交一下,.gitignore文件里的规则就可以起作用了
git rm -r --cached .git add .git commit -m 'update .gitignore'
清缓存生效方法参考:http://niltor.net/index.php/Home/Blog/showblog?id=5
更多相关文章
- [Android(安卓)Pro] android 混淆文件project.properties和progu
- 简单的 Android(安卓)拍照并显示以及获取路径后上传
- Android(安卓)高通代码预制apk可卸载,恢复出厂设置apk可恢复 Andr
- 如何在Android平板电脑POWER按钮菜单中添加休眠功能
- Android--sharepreference总结
- Android(安卓)sdcard文件读写操作
- 解决Android模拟器打不开的问题!...
- Android(安卓)tips2
- NPM 和webpack 的基础使用