简体   繁体   中英

How can I update an existing SVN repository from an exported copy?

Late one afternoon, I did an export of my project repository and took home my work on my USB key.

I've added many changes to the exported project, and now, having returned to the workplace, I want to update the repository with the project that I've now got.

To complicate matters, I've made updates to the project in both the main trunk and a branch - and I'd like to update the repository to reflect all those changes.

I'm new to SVN and have been relying on TortoiseSVN, but I'm a bit lost now.

Would I be best to delete the repository and recreate it from the copies/branches I now have?

Disclaimer: I'm not entirely sure whether this is the optimal solution and whether there aren't downsides. I can't see any, because the important .svn directories are not being touched, but I'm no SVN Guru. I recommend you make backups (well, one should anyway) and see what other answerers have to say.

If you're on Windows, I think it should be possible to do the following:

  • Check out a working copy (eg into /myproject )
  • Take the /myproject folder from the USB stick and copy+paste it over the local /myproject checkout
  • Windows Explorer should now integrate the two folders, leaving the invisible (and essential) .svn files in place, but adding any changes and new files from your exports.

  • You should now be able to do a "check for modifications" in Tortoise. Changed files should turn up as changed; new files and directories should be able to be added. The only thing this method will not cover is files and directories you deleted in your export.

You would have to do this individually for each branch I think - or at least I would do it just to make sure. But that is probably a minor inconvenience.

Short answer: you can't. You shouldn't have "exported" your repository, but "checked it out".

Perhaps the easiest way (depending on the size of the changes) would be to check out the repository in another directory, and manually copy your changes over that. Then commit all changes.

不确定什么是最好的,但是我和您的情况相似,删除和重新创建对我来说是最好的出路。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM