Remko
Remko

Reputation: 958

How to ignore files/folders using SVN in PHPstorm

I want to create a new repository but don't want to include folders with cachefiles etc. I tried everything but it keeps committing all files and folders. In my project overview the folders are marked as 'ignored' for SVN and when doing a initial import I uncheck the box for committing ignored files/folders.

Upvotes: 1

Views: 4102

Answers (1)

Steve Barnes
Steve Barnes

Reputation: 28390

Judging from the fact that on the PHPStorm web site version control helps I can find no mention of "the box for committing ignored files/folders"

It sounds like you are:

  1. Setting a load of files/directories up as ignored
  2. Starting a commit but
  3. Not including .svnignore in the commit
  4. finding your ignores are ignored.

The problem is that svn stores the details of what to ignore in a file called .svnignore which, if you would like your ignores to be persistent and common to all users, has to be committed itself.

Update

I think that the process that best fits your use case here is as follows, (sorry if I am teaching grandma to suck eggs), assuming that your bare repository already exists and has a standard structure like:

URL/trunk
URL/tags
URL/branches

This is the general process with the command line tools but can be adapted:

mkdir a_new_directory
svn co URL/trunk a_new_directory
cd a_new_directory

Copy the directory structure of your project to here including the ones you would like to ignore, (no files just the directories). In a text file list the relative path of all the directories you would like to ignore, one per line, each with forward slashes if you are no windows and all ending with a forward slash:

svn propset svn:ignore -F the_text_file.txt

If you have some file types that you would like to universally ignore, e.g. .bat and .obj files:

svn proprev svn:ignore -R *.bat
svn proprev svn:ignore -R *.obj

I personally put a dir_info.txt file with a description of each directory into that directory and add them.

svn add all the directories, (and dir_info.txt files), then commit.

Then add your files to the directories, svn add them and commit.

Upvotes: 1

Related Questions