I lost my SVN repository
My SVN repository was installed on a server and this server got down, I have three working copies and all of them made so开发者_开发百科me changes and not commit them to the base What to do in this case, please help me
Does this mean you have lost the repository?
In that case (if you have no backups at all) I guess the simplest thing to do would be:
- Create a new repository somewhere.
- Choose one of your working copies (start with the oldest one, i.e. the one with less changes).
- Make a check-out of your new repository into an empty folder on that machine.
- Export your working copy (do not copy it) to the empty folder you got in step 3. Since you are probably going to delete you old working copies later, it would be wise to Export unversioned files also (if you are using Tortoise SVN, there is a checkbox at the top of the Export dialog).
- Commit you changes.
Repeat steps 2. to 5. for all working copies you have. During step 5., you will need to merge things manually. Take care to add any unversioned files, if needed.
You will have lost all the previous revision history, but no working data should be lost this way, provided that you have all the working copies.
Make patches in each working copy, using svn diff > a.patch
, then apply on one working copy patches from other two: patch -p0 < a.patch
.
Next time, use some DVCS, something like Git or Mercurial :)
Do you have a backup of the repository? If yes, load it with svnadmin
somewhere and then commit the changes to this new place. Use svn switch
to point your working copies to the new server.
If no, then you have lost the history of your project and there is no way to get it back.
All you can do is to create a new repository somewhere and commit the three individual copies one after the other to it. You may have to delete all .svn
directories in your working copies to do that.
Use a DVCS like Mercurial or Git to avoid situations like that (and lots of other problems).
精彩评论