I'm working on a project myself. I have subversion setup and using tortoisesvn to manage it. Problem is I have started from scratch and have a separate fully working instance of my project but it's not in subversion.
How do I get that instance into subversion and have as the most recent revision. I tried pasting in files from my non-svn directory over my current svn working copy but not everything appears to have been updated.
I have backups of everything, but i开发者_开发技巧t's the code that is in the non-svn folder that I want, I don't want anything from the current working copy?
Does this make sense?
The easiest way to replace the contents of an SVN repository with something completely different is to:
- Do a full checkout of the repository,
- Delete all the files (Not by using the Windows 'Delete' command, but by using the 'Delete' menu item in the SVN right click sub-menu)
- Commit the change,
- Copy over the new files and folders you're replacing the old repository contents with,
- '+ Add' it all (again, using the SVN right click menu)
- Commit the change again.
The downside of this 'easy' method is that you will not be able to use Diff to compare code between these two revisions.
The hard method is to retrace the steps of what files were moved, renamed, deleted, and updated so that you can still use diff between these two revisions. The trick is:
- To do everything using SVN right click sub-menu commands, not windows file system operations, so that the changes can be recorded.
- To only do one action per file at a time (so if a file was moved to a folder, renamed, and then modified, you should do a commit between each type of change)
I would use WinMerge and compare the two directories, recursively (ignoring .svn folders). Suppose the left side is the SVN working copy, and the right side is the correct project, not under SVN :
- all files existing at the left side but not at the right side must be deleted
- all files existing at the right side but not at the left side must be copied to the left and added to SVN
- all files existing at both sides but not the same must be replaced at the left side by the file at the right side
- all files existing at both sides and identical must stay as is.
Once you have done all these operations, you just have to commit. This way, you'll keep history, except for renamed/moved files.
精彩评论