TortoiseSVN not importing some files? Fix your permissions.

If TortoiseSVN (or SVN in general) seems to be skipping over some files when importing a project, there are a couple of causes to be careful of.

First, make sure your permissions are set correctly, I just do the following in a dos box (after installing cygwin, of course..) in my project folder before import:

  1. chmod -R 777 *

If you’ve already imported your project and the project folder is versioned, and TortoiseSVN is still giving you hell, you may have to right click on individual files it previously skipped and select tortoisesvn->add from the popup menu. Doing this at higher levels in the directory structure won’t even show the permission-fixed files as addable 🙁

If that doesnt seem to solve your problem, you may want to search for svn ignore properties.

If all else fails, here’s what I did:

  1. Open your SVN trunk in TortoiseSVN’s repo-browser.
  2. Delete everything from trunk here by right clicking, and selecting delete. If you try to delete more than one thing at a time, it’ll show a bogus error about “can’t find file xyz”, just delete one a time.
  3. Make an empty folder on your hard drive, check out trunk there.
  4. Copy all files over from your old project folder to this directory (without .svn folders and files therein!).
  5. Fix permissions for all copied files.
  6. Do TortoiseSVN import.

In our particular case, we were trying to boostrap a cocos2d-x android project and check the entire versioned distribution and our project subfolder into SVN for simplicity’s sake. The latest cocos2d-x distribution zip file has several files (particulary .a compiled libs) with odd permissions when unzipped. Upon import, those critical lib files aren’t checked in, and your teammate on the other side of SVN is hosed.