Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Import excluding files

Tags:

svn

I have a project I'm going to be importing into SVN, but I want to keep the existing cache, index, media, etc... out of the repo. What is the best way to do this during an import?

like image 486
veilig Avatar asked Jan 25 '12 14:01

veilig


People also ask

How do I ignore files in SVN?

The svn:ignore property One of these properties is svn:ignore . How this works is that you use the command svn propset to set the property svn:ignore on a particular directory. You give svn:ignore a value, which is a file name pattern. Then, svn will ignore all items in this directory whose name matches the pattern.

How do I import files into SVN repository?

Use the repository browser to locate and select the folder into which your files should be imported. Select the File > Import… menu item. Alternatively, either right-click on the receiving folder and select Import… from the action menu, or click the Import button.

When import option is used in SVN?

The svn import command is a quick way to copy an unversioned tree of files into a repository, creating intermediate directories as necessary. svn import doesn't require a working copy, and your files are immediately committed to the repository.


3 Answers

I usually work around the selective import problem like this:

  • Create the root folder of your project in the repository
  • Check out that root folder, into your local copy root
  • Now you can choose what must be added and/or ignored
  • And finally you commit the root folder

Slightly more work, but more control.

like image 123
gerrie Avatar answered Sep 28 '22 06:09

gerrie


You can use the svn ignore list. Via the command line:

svn propedit svn:ignore ./path-to-ignore
like image 36
OnResolve Avatar answered Sep 28 '22 05:09

OnResolve


I would say the safest way of doing this is to try to get the cleanest possible directory tree prior to the import, deleting all the files you don't want. Alternatively you can set the global-ignores value in your subversion client config file (~/.subversion/config on Linux/Mac, or accessible via Tortoise SVN -> Settings -> Subversion configuration file).

I'd suggest also setting the svn:ignore properties for each directory once you've done the import to prevent users from accidentally checking these files in.

like image 37
the_mandrill Avatar answered Sep 28 '22 05:09

the_mandrill