Android项目文件夹通常很大,几十到几百M,但我们再上传到SVN 或打包发给其他人时,并不需要把所有文件打包。这里说下AS下如何设置上传到SVN忽略一些文件。
需要在share到svn之前设置 1.File->Settings->Version Control->Ignored Files,3种方式添加忽略文件(指定文件,指定文件夹,匹配),通常忽略.gradle文件夹 .idea文件夹,项目和个moudle的build文件夹,local.properites文件,.iml文件。 Patterns
Two characters can be used as wildcards:
*: to replace any string. ?: to replace a single character. For example, .iml will ignore all files with the iml extension; .?ml will ignore all files whose extension ends with ml.
2 VCS ->Import into Version Control ->Share Project(Subversion)。将项目分享到SVN上。
灰色就是忽略的文件,下一步可以svn commit,(右键Test文件夹,Subversion ->Commit Directory,或者工具栏vcs图标 ) 可以看到要上传的文件中不包含忽略的文件。
打包项目文件夹时也可以忽略这些文件,大大减小项目文件大小。