How can I restore svn control if the .svn folder has been damaged?

前端 未结 7 870
春和景丽
春和景丽 2021-02-01 04:03

I\'ve got a couple large checkouts where the .svn folder has become damaged so I\'m getting and error, \"Cleanup failed to process the following path..\" And I can no longer com

相关标签:
7条回答
  • 2021-02-01 04:30

    I encountered the same error today. It happened when I tried to switch branches and fail to delete one of the file that is not in svn repository. After that, the folder was locked and I can't use any command to get it work again.

    I basically deleted what I had and redo the checkout. It is time consuming, but I really want to make sure svn is clear before I can start working again. Thanks!

    0 讨论(0)
  • 2021-02-01 04:31

    The selected solution worked for me to restore the top-level .svn folder, but it doesn't recognize the child objects, so everything seems foreign to SVN at this point, despite versioning being intact in subfolders.

    0 讨论(0)
  • 2021-02-01 04:32

    If you know which folder has the damaged .svn directory, you can just delete that one directory and run an svn update again. You may have to delete the whole directory including its current contents. Of course, if the folder with the damaged .svn directory is the one containing a gigabyte, then you're back where you started.

    0 讨论(0)
  • 2021-02-01 04:36

    Make a backup of the folder that has the missing .svn

    Then delete the folder

    If it is the root of the checkout, you will have to re-checkout

    If it is not the root, just run an update from a directory above.

    Then move the backup folder on top of it. (Ideally do not move back the .svn folders)

    Continue working and be sure to update/commit!

    0 讨论(0)
  • 2021-02-01 04:42

    In case you have changes to the files, and cannot delete them, you can use the Subversion 1.5 feature that allows you to 'checkout with obstructions'.

    Just delete the .svn directory in this directory and:
    (you don't need to delete inside directories when using --depth files, thanks Eric)

    In case the broken directory was the top directory of the working copy:

    svn checkout --depth files --force REPOS WC
    

    And if the directory above the broken one is still versioned run:

    svn update --depth files --force WC
    

    in that directory.
    In both samples REPOS is the url in the repository that matches the broken directory, and WC is the path to the directory.

    Files that were originally modified will be in the modified state after this.

    0 讨论(0)
  • 2021-02-01 04:47

    I've hit this in the past and found no working solution except the "nuclear option" (i.e. delete the directory and re-checkout).

    Not sure if this is your problem, but my corruption was being caused by an on-access virus scanner on the same machine as SVN server.

    0 讨论(0)
提交回复
热议问题