Reputation: 283335
I've created a repo, and then I ran svn import . https://myrepo
. It seems to have checked everything in nicely, and I can check it out on my other machine. However, it doesn't seem to create the .svn
folder, so I can't run any svn ci
commands at a later date.
This creates massive headaches to try and sync up later, because now all my stuff is already in the repo, but it conflicts with the changes I'm trying to commit.
What am I doing wrong?
Upvotes: 18
Views: 10668
Reputation: 106
I wanted to provide an update regarding using TortoiseSVN after an import. TortoiseSVN will now allow you to check-out into a non-empty folder.
Therefore, you can simply check-out into the same folder you used for the import. TortoiseSVN versions all the files inside, detects that they all match, and does not download/overwrite anything. No more having to rename the source folder and then check-out into a new empty folder.
This was tested on Windows 7 using TortoiseSVN version 1.8.0, Build 24401 - 64 Bit , 2013-06-17T18:15:59 (Subversion 1.8.0, -release).
Example:
Folder C:\myfiles has the data.
Import that folder into SVN at http://example.com/svn/myfiles
Check-out http://example.com/svn/myfiles into C:\myfiles.
TortoiseSVN warns that the destination is not empty, click Ok.
TortoiseSVN then places C:\myfiles and its contents (which currently match the repository) under version control, without having to modify/download/replace any files.
Upvotes: 2
Reputation: 2462
Only a working copy will have an .svn folder. Import doesn't create a working copy. (Why not? Well suppose for example you were trying to import from media where you don't have write permissions. In that case if import tried to create a working copy, it would fail). To create a working copy, you must use checkout.
Put another way, import pushes information to the repository. That's all it's intended to do, it has no impact on the original files. Most subversion commands only work in one direction: checkout, export, and update modify files on the local system/working copy. import and commit only update the repository. Aside from [un]lock operations, I can't think of a command which simultaneously impacts both the repository and the working copy.
Upvotes: 6
Reputation: 6605
I never use import because it's uncomfortable. Import doesn't create .svn directories, you'll have to run an additional checkout of the newly imported directory.
Instead of importing files I first create an empty directory in the repo and check it out into my existing project's directory that I want to "import". Then you can simply run commit and it'll add all files.
Upvotes: 32
Reputation: 166
GAHHHHHHHHH... DON'T USE TORTOISE-SVN TO DO THIS - it will wipe out your local directory.
Sooo......... make a zip/copy somewhere else first !.. sigh... (at least I had a previous - old though - zipfile).
Upvotes: 0
Reputation: 8645
After you've imported, you can run svn checkout --force
to convert the imported directory into a working copy.
Upvotes: 1
Reputation: 874
When you setup a project with subversion, after the initial import of your project, you should check the project out and continue work on the project in the copy that you checked out. I think the problem is that you kept on working on the copy that you checked in.
Upvotes: 1