Question

I'm trying to ignore the build folder in my project, I've tried adding the svn:ignore property recursively to it, added in to Settings > Version Control > Ignore Files, from the right click menu under Subversion I can't choose the Ignore option, it's greyed out. After I've done all that when I choose commit directory on the project the build folder still shows up. What's the correct way to make the folder be ignored?

Was it helpful?

Solution

I am new to Android Studio too. I tried this method to not use plug-in nor command lines. Only uses Android Studio interface (version 1.5.1).

  • First step, as Kenneth Evans' good answer says, is declare all resources that must be ignored in File > Settings > Version Control > Ignored Files. These resources are:
    Mask: *.iws (select Ignore all files matching option to add this pattern)
    Directory: .gradle
    Directory: .idea/libraries/
    File:.idea/workspace.xml
    Directory: build/
    File: local.properties
    Directory: app/build/ (this must be for every module your project has)
    Mask: *.iml
    File: .DS_Store
  • Next step is Revert these resources (files and folders) to their initial state in repository

I have a project with several modules, each of them with a build folder. If this is your case, can avoid wasting too much time and try one module. Test if this process is successful and apply to all of them.
First you see build folder in green color because it's attached to svn repository. Right click it and choose Subversion - Revert. This process is unrelevant because all files in this folder will be rebuilt next time you build your project. If you dare, can mark all folders that must be ignored in order to be reverted. Once Revert finishes, folder names are showed in brown color

  • Make a commit of the project - this updates which resources must be taken into account when commit is made. It takes a while beacause all files that were marked before as included in commit process, now are being unmarked. When this long process finishes, shows a dialog where all excluded resources are not showed or a message with "No changes" instead

Now local.propeties file can be right-click and choose Subversion > ignore local.properties
Compile your project an try commit - make some change at any source to force compile and build your project.
Finally commit directory from project (right click project and choose Subversion - Commit Directory...). This final step allows test that now, it is really faster because these excluded resources doesn't appear in commit accept dialog

OTHER TIPS

When you add files or folders to VCS they are added to the Default Changelist. Move the files and folders you wish to ignore into a different Changelist (perhaps called ignored). Finally, only commit the Default Changelist and ignore the ignored Changelist.

I had the same problem. There was nothing in the repository, until I did Share Directory on the project. It then created the folder for the project in the repository. I entered the following in Settings|Version Control|Subversion:

  • File:.idea/workspace.xml
  • File: .gradle
  • Directory: build/
  • Mask: *.iws
  • Directory: .idea/libraries/
  • Directory: app/build/
  • File: local.properties

and it didn't ignore anything in the Changes View or when committing. The Subversion|Ignore item was not working as above.

I got it to more or less work by installing the SVN Disconnect plug-in at https://plugins.jetbrains.com/plugin/6529?pr=idea and running it. This cleaned things up, and I started over. This time it ignored the Directory: items, but not the File: ones. Apart from this glitch, it seems to be working. The menu items for Subversion|Ignore or Subversion|Remove from ignore list appear to be working as expected, now (but the ignore doesn't happen).

I have Tortoise SVN installed, and it doesn't mark the directory as being in SVN in Windows Explorer as it does for Eclipse projects. However, the repository browser shows the files.

I am new to Android Studio. The Subversion implementation seems buggy and is only 1.7. I didn't see this bug for either Android Studio or IntelliJ. I'll continue to try it as is for now, and if there is more trouble, clean it up again, and start over with Tortoise SVN from outside Android Studio.

I realize this is not a full answer, but maybe it will help.

Creative solution that worked for me: use 'git svn' to use git locally and push to svn

Sadly, doing this took longer than it should have for me, because there was some svn corruption in prior changesets that git couldn't get past. Once in git land everything around ignores started working as one would expect. Probably a bug in the svn plugin.

I managed to ignore the libraries folder by using the console:

  • cd to .idea of your project
  • svn propset svn:ignore libraries .

Additonally I had to "unadd" the files by simply reverting all files in the library folder, closing Android Studio and reopening the project.

Files are now ignored in the Version Control view.

In Android Studio interface, I tried setting the properties svn:ignore with value true for the files I wanted to ignore. For some reason, it didn't work for me. So, an alternative quick work around for me was: to move those files to a new changelist. When you modify a file, that file is added to the "default" changelist. So, every time I open the commit window, I see the "default" changelist(which will have only the files that I want).

Personally I'm using TortoiseSVN to manage ignore list and other more advanced stuff.

For me it's much more reliable method, but of course I'm still using VCS in Android Studio since it has many cool features like info about incoming changes.

Move back to eclipse - its a lot more developer friendly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top