How to fix path is not a working copy directory and working copy is already locked errors

A few days ago I was writing some code to generate reports. After the reports were generated, the reports were emailed, then deleted off the server. I made a mistake and deleted the contents of the directory.

This was a bad thing because all of the .svn files were also deleted. I tried to replace the directory contents with the latest from SVN and I got an error. I tried to update my working copy and got an error. No matter how I interacted with SVN, I got one of the following errors:

  • Path is not a working copy directory
  • Working copy is already locked
  • Working copy '[directory]' is missing or not locked

To fix this:

I manually removed the directory entirely from my local copy. Then I updated to HEAD from SVN. This created the directory I accidentally deleted, put the files back and also added in the .svn files that were missing (and causing the working copy errors)

Apparently, if the directory exists, and SVN doesn't find the .svn files it is looking for, it gets confused. Removing the directory is enough for it to recreate it. (Since the missing directory was tracked in the parent directory .svn files)

Hope this helps you out!

There are no comments for this entry.

Add Comment Subscribe to Comments

9/2/10 4:38 PM # Posted By Jim Priest

I've done that before! I find it's always a good idea to interact with any files (delete, rename, move, etc.) under version control through SVN. TortoiseSVN on Windows makes this easy with it's shell integration.


10/7/10 4:35 AM # Posted By Mike Blyth

Thanks, that worked and was easy! I had to copy the contents of the "bad" folder back into the new one, rather than just copying the whole folder again.


5/8/12 9:36 PM # Posted By Greg

From Tortoise menu: Release lock


8/26/13 9:16 PM # Posted By garrydam

With Path too long error I use "Long Path Tool" to get fast and easy fix .


12/25/14 8:42 PM # Posted By patrick8

Hi

I suggest to try "Long Path Tool" program .

before I have problem cannot copy file because file name too long. and after I found long

path tool and now my problem solved

Thanks

Patrick


12/25/14 8:47 PM # Posted By patrick8

Hi

I suggest to try "Long Path Tool" program .

before I have problem cannot copy file because file name too long. and after I found long

path tool and now my problem solved

Thanks

Patrick


1/25/15 6:00 AM # Posted By FGranados

Long Path Tool works well to copy or delete long path files, you may use it and I m sure you will love it.


1/25/15 6:08 AM # Posted By FGranados

Long Path Tool works well to copy or delete long path files, you may use it and I m sure you will love it.


2/11/15 7:08 AM # Posted By keywin

Howsoever long the path may be, you can always rely on Long Path Tool. Its sure to sort out your problem.


2/11/15 7:10 AM # Posted By keywin

Howsoever long the path may be, you can always rely on Long Path Tool. Its sure to sort out your problem.


2/11/15 7:11 AM # Posted By keywin

You can also use Long Path Tool to sort out this problem.


Add Comment Subscribe to Comments