开发者

How can I change the files initially imported into an SVN repository?

开发者 https://www.devze.com 2022-12-11 20:11 出处:网络
I have created an SVN repository for project but now realise that the files initially imported are not the most recent.

I have created an SVN repository for project but now realise that the files initially imported are not the most recent.

When I compare the 2 versions of the project with Beyond Compare, the projects do not have the exact same set of files within them. Both project folders have some files which are unique.

I want to now add the correct files to the repository but am not sure of the bes开发者_运维百科t approach.

  • I could delete the repository altogether and start afresh. Although I remember this being problematic in the past as the repositories will have the same name
  • I could try to copy the correct files over the exisitng ones and commit. Although there may be old files which are not overwritten, resulting in old files commited to the new project.

What would be the standard SVN approach in this case?


Just use your second approach and replace your existing files with the correct files, then commit.

What do you mean with old files which are not overwritten? If they are not overwritten it just means you didn't replace them because they are already the right files.

So, no problem.

If you're talking about files that have been deleted in the newest version then do a folder/file compare with a tool of your choice (like Total Commander) and let the tool delete the files on one side which are not present on the other. Then commit again.

Important: Commit the two steps separately.


I don't think there's a standard way to do this. This depends on your circumstances - which we know little about.

From what you wrote, you could either change a working copy with the diff between the two versions (and you would then have to deal with addition/removal of files) or you just delete the old project folder and add one containing the new files instead. I think the latter would take at least two commit to succeed (you cannot remove and add the same item in one commit), the former could be done with one commit.


I would follow these steps:

1) Get a clean and updated working copy. Clean = no modifications. Updated = you know.

2) Delete all files. Keep the folder structure. Be careful of not deleting any .svn folder nor any file inside those.

3) Copy the new files to the working copy.

4) Commit.

An alternative to 2 and 3 would be:

2b) Copy the new files to the working copy overwriting the old files

3b) Use Beyond Compare to detect which files you have in the working copy that shouldn't be there as they don't belong to the new files. Delete these files until the working copy and the new files folder are identical except for .svn folders (you can filter these out in BC)

0

精彩评论

暂无评论...
验证码 换一张
取 消