user206705
user206705

Reputation:

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?

Upvotes: 1

Views: 389

Answers (3)

jeanreis
jeanreis

Reputation: 908

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.

Upvotes: 2

Pekka
Pekka

Reputation: 449385

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 (e.g. 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.

Upvotes: 4

Shamim Hafiz - MSFT
Shamim Hafiz - MSFT

Reputation: 22064

Not sure what's best, but I was in similar situation to yours and deleting and recreating was the best way out for me.

Upvotes: 0

Related Questions