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?
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.
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.
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.
I usually work around the selective import problem like this:
Slightly more work, but more control.
You can use the svn ignore list. Via the command line:
svn propedit svn:ignore ./path-to-ignore
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With