mpen
mpen

Reputation: 282805

SVN: How to import folder keeping folder name?

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.

Upvotes: 4

Views: 6019

Answers (2)

Patrick Johnmeyer
Patrick Johnmeyer

Reputation: 32552

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:

  1. create the path intervening if it does not exist
  2. create the path media if it does not exist
  3. import the contents of static into the repo path

Upvotes: 3

ChrisH
ChrisH

Reputation: 4826

You could move or copy static into the project folder and type:

svn add static
svn commit -m "adding static folder"

Upvotes: 0

Related Questions