33

I'm working with a large application I've checked out from my repository, the bulk of this app is in the .svn/pristine folder. From what I understand, the pristine folder contains copies of the files in my workingCopy directory

That being said,

  • Would it be okay to delete these files?
  • Do I really need them?

I have my files backed up already and no intention to revert. The extra space gained would dramatically cut my compile time as well.

EDIT

I now understand that changing anything manually inside .svn will likely break my workingCopy.

I need to find a way to reduce the size of my workingCopy. In TortoiseSVN, there is a Cleanup - Delete unversioned files and folders, which "removes all generated files in your working copy". Perhaps this would get rid of those files without breaking my application?

Cheers

Clay Banks
  • 4,483
  • 15
  • 71
  • 143
  • 3
    Any changes directly to the .svn folder or its contents is likely going to break your working copy. – crashmstr Mar 28 '14 at 13:55
  • If I understand correctly your problem is long project's compile time, and you believe that compile time will be reduced by removing .svn folder. I don't think that's true. How can it be true? – Dialecticus Mar 28 '14 at 14:05
  • 1
    I don't want to remove the `.svn` folder, the `.svn` folder contains a folder titled `pristine` which contains copies of your current project. I have no use for these copies which take up a ton of space, and reducing the size of my project will also reduce the time it takes to compile. – Clay Banks Mar 28 '14 at 14:09
  • 3
    Unless your build system blindly compiles all files in all subdirectories of your project, build time should not be affected. If your build system DOES do this, fix your build system. That is a terrible way to build. – Ben Mar 29 '14 at 05:34
  • 2
    This is a legitimate question in terms of freeing up disk space. I found that my .svn/pristine folder was taking up more than 1 GB of space - more than 90% of the overall WC of which it is a part. Running the 'Clean up' command through TortoiseSVN freed up much of this space. Still, I'm made to wonder, what might cause these files that were taking up all this disk space to come back again? – Stewart Apr 06 '18 at 16:36

3 Answers3

71

You may try to launch svn cleanup. It will remove unnecessary files from .svn/pristine.

Jérôme Pouiller
  • 9,249
  • 5
  • 39
  • 47
  • 10
    In my opinion this is the correct answer to OPs question. It is NOT safe to delete .svn/pristine. But if you want to safe disc space, run svn cleanup to reduce it. – Gerrit Oct 15 '14 at 07:13
17
  • You must not touch the directory .svn in your working copy manually. The directory is required for client-side operations.

  • The .svn directory stores working copy metadata and pristine copy of WC files for client-side operations only, it must exist in each SVN working copy but not in SVN repository. Storing it in Subversion repository can lead to errors on the client side.

In other words, you must not store the directory .svn in the repository. If you have this directory in the repository then someone has mistakenly committed it.

See SVNBook | Subversion Working Copies:

A working copy also contains some extra files, created and maintained by Subversion, to help it carry out these commands. In particular, each working copy contains a subdirectory named .svn, also known as the working copy's administrative directory. The files in the administrative directory help Subversion recognize which of your versioned files contain unpublished changes, and which files are out of date with respect to others' work.

I guess that you store large binaries in your repository / working copy. I don't think that you'll be able to solve the working copy size issue without reorganizing your SVN repository.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • 1
    I don't have an `.svn` directory in my repository, just my working copy. – Clay Banks Mar 28 '14 at 13:52
  • 1
    @ClayBanks I've updated the answer: **do not touch `.svn` directory**. – bahrep Mar 28 '14 at 13:54
  • thanks for your input. I've edited my question as well. Would `Deleting unversioned files and folders` accomplish the task at hand? – Clay Banks Mar 28 '14 at 14:03
  • @ClayBanks I don't think so. This option will delete only unversioned items in your WC. It won't touch contents of the `.svn` folder. See the updated answer (the last item in the list). – bahrep Mar 28 '14 at 14:09
  • Thanks @bahrep, I'll look for alternative methods to reduce the size of the project* – Clay Banks Mar 28 '14 at 14:11
7

It turns out that my real reason for the long build was Eclipse's validators! I turned off all validators for JavaScript and the build happens almost instantly. Unbelievable.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Clay Banks
  • 4,483
  • 15
  • 71
  • 143