首页 > 移动平台 > 详细

Android Studio的.gitignore以及gitignore无效的解决

时间:2015-07-02 02:17:32      阅读:4209      评论:0      收藏:0      [点我收藏+]

  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 files
bin/
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 Eclipse
proguard/

# 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 Studio的.gitignore以及gitignore无效的解决

原文:http://rewufu.iteye.com/blog/2223365

(0)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!