SVN: How to import folder keeping folder name?

svn

Solution

You are already very close.

svn import static https://myrepo/media

Would place the contents of static into the path myrepo/media on the server, even if media does not yet exist. Note that if there are intervening paths that do not yet exist in the repository, Subversion will recursively create them. For example, `svn import static https://myrepo/intervening/media` would:

- create the path intervening if it does not exist

- create the path media if it does not exist

- import the contents of static into the repo path

Problem

I have a version controlled project located at `~/webapps/django/myproject` and media files located at `~/webapps/static`. I want to add the static folder to the same repo so that when it's checked out, it will be in the project folder, preferably with the name "media". I've tried going into the webapps folder and doing `svn import static https://myrepo` but it imports all the stuff inside static, but excludes the "static" folder itself, making a big mess in my project folder. If you're wondering, I'm doing this because there's a bit of a discrepancy in the way my development server and production server are set up.

Original source