Folder is locked and I can't unlock it
Asked Answered
H

19

111

When I'm trying to update or commit code from a project it's telling me that the folder is locked. When I try to "release lock" it says that there's nothing to unlock in this working space.

What does that mean? Why I can't update, commit or even clean up the project.

Handcraft answered 4/4, 2012 at 20:42 Comment(6)
Which version of svn are you using?Chichi
Assembla for a repository , Tourtise SVN 1.7Handcraft
So do you have a .svn folder in each directory or just the root?Chichi
Have you tried checking out the project again into a separate working copy?Tympanites
Yes its working if i check it in a different folder , but the database isn't openingHandcraft
Chris i have only .svn folder in the rootHandcraft
C
167

Right click on your Subversion working directory folder, and select TortoiseSVN->Clean Up from the Context Menu. This will recurse its way through your working directory and cleanup any incomplete actions, remove the local locks (which is different from using Subversion locking of a file in the repository which lets everyone know about the lock).

If that doesn't work, see if you can find the names of the files that were changed, but not yet committed, save them, and redo the checkout.

Cyte answered 12/4, 2012 at 21:11 Comment(3)
I had this issue and clean up didn't work (failing to clean up because of the local locks), but going up to the parent folder (which was also under version control) and doing the clean up there fixed the problem.Galipot
You can break the local locks by checking Break locks option.Bronnie
@Galipot 's comment is precious. Should post this as an answer.Statfarad
C
17

If the file was locked by yourself(same svn account), you can follow these steps:

Right click on the locked file or folder, and select TortoiseSVN->Get lock... , and check on "[] Steal the locks" at the bottom left corner of the dialog, click "OK". If it complete successfully, that's ok. When you right click on the file again, you can see TortoiseSVN->Release lock..., click to unlock.

Cp answered 11/9, 2012 at 9:32 Comment(0)
C
12

Using svn command line to unlock the local folders, just use svn cleanup.

Before:

# svn commit -m "fixing #1234"

commit

# svn st

before

# svn cleanup

After:

# svn st

after

# svn commit -m "fixing #1234"

after2

Cressler answered 18/10, 2014 at 18:28 Comment(1)
Downvote for posting textual information as screenshots.Alliance
K
10

To anyone still having this issue (Error: Working copy '{DIR}' locked.), I have your solution:

I found that when one of TortoiseSVN windows crash, it leaves a TSVNCache.exe that still has a few handles to your working copy and that is causing the Lock issues you are seeing (and also prevents Clean Up from doing it's job).

So to resolve this:

Either

1a) Use Process Explorer or similar to delete the handles owned by TSVNCache.exe

1b) ..Or even easier, just use Task Manager to kill TSVNCache.exe

Then

2) Right click -> TortoiseSVN -> Clean up. Only "Clean up working copy status" needs to be checked.

From there, happy updating/committing. You can reproduce Lock behavior by doing SVN Update and then quickly killing it's TortoiseProc.exe process before Update finishes.

Kohlrabi answered 4/3, 2013 at 20:51 Comment(0)
L
10

This was the first time I had this issue. I even tried to restart PC, without effect. This solves my problem:

Solution for me:

  1. Right Click on Project Working Directory.
  2. Navigate TortoiseSVN.
  3. Navigate To Clean Up.
  4. Leave all default options, and check Break Locks
  5. Click OK

This works for me. I was able to commit changes.

Laird answered 1/8, 2016 at 22:1 Comment(3)
Checking the Break Locks checkbox fixes my issue.Kellam
This is the perfect answer I have been looking for. Thanks a tonMunicipal
This should be the correct answer. Practical, easy and straight to the point!Salutatory
N
3

To unlock a file in your working copy from command prompt that is currently locked by another user, use --force option.

$ svn unlock --force tree.jpg

Neogene answered 23/4, 2014 at 5:52 Comment(4)
What if I want to unlock a directory?Kylix
@Kylix Give directory name instead of file name in above commandNeogene
@Kylix what error msg are you getting. Let me checkNeogene
The node is not a file!Kylix
F
3

I had this issue and i have done below steps to resolve it:

  1. Go to parent folder instead of child folder
  2. Select SVN cleanup
  3. Click on OK.

Do this step on parent folder instead of child folder!

It worked for me !

Fanny answered 21/10, 2015 at 15:22 Comment(0)
C
1

I was moving a folder up one level and into another folder. My mistake was doing the move from within the parent folder.

Bad example:

pwd -> C:\Repo\ParentDir\
svn move ./DirtoCopy ../AnotherDir

SVN needs to update the parent directory with the deleted folders info.
You have to do it from the common root of the source and destination folders or use full paths.

Good example:

svn move C:\Repo\ParentDir\DirtoCopy C:\Repo\NewLocation
Crowboot answered 18/4, 2016 at 14:51 Comment(0)
K
1

To unlock a blocked document: 1. Right click -> Lock 2. Check the "Steal the locks" check box 2. Release the lock

Konikow answered 6/12, 2016 at 12:31 Comment(0)
M
1

I had this problem where I couldn't unlock a file from the client side. I decided to go to the sever side which was much simpler.

On SVN Server:

Locate locks

 svnadmin lslocks /root/of/repo
 (in my case it was var/www/svn/[name of Company])

 You can add a specific path to this by svnadmin lslocks /root/of/repo "path/to/file"

Remove lock

 svnadmin rmlocks /root/of/repo “path/to/file” 

That's it!

Mahala answered 9/11, 2018 at 15:42 Comment(0)
B
0

Solution :

  1. Right Click on Project Working Directory.
  2. Navigate TortoiseSVN.
  3. Navigate To Clean Up.
  4. Select Clean up working copy status(make checked mark)
  5. Click OK
  6. Repeat Step 1 and 2 then navigate to release Lock.
  7. Click OK Your project lock get opened.
Beall answered 23/12, 2013 at 8:59 Comment(0)
A
0

In addition to David M's answer, while doing cleanup -> check 'break locks' option. This will ensure release of locks. Then do svn update. This worked for me.

Anthologize answered 18/5, 2016 at 6:22 Comment(0)
T
0

I research a lot on this issue but no solution fix my problem until I try this:

My repo folder is shared with a Windows xp virtual machine, so I execute the clean up from the VM and then execute SVN UPDATE from the host.

It worked for me.

Greetings from Costa Rica.

Transcription answered 11/7, 2017 at 16:32 Comment(0)
F
0

I was able to resolve this issue on my machine by renaming folders to make the folder path smaller.

Formaldehyde answered 20/5, 2019 at 20:59 Comment(0)
V
0

I encountered similar issue, it told me that some files has been locked by xx. However, xx said he has release lock and he cannot find the lock on TortoiseSVN.

clean up doesn't work for me. I have to ask he go to TortoiseSVN -> Repo-browser, find the corresponding files, then right click these files and choose break lock.

Vexed answered 19/7, 2021 at 9:41 Comment(0)
Y
0

I fixed it doing:

  • Lock again all the folders (Get lock...)
  • Unlock it again (Release lock...)
  • Then I was able to commit without issues

Clean up was not working for me

Yore answered 30/8, 2023 at 10:55 Comment(0)
E
-1

I had this happen after having Tortoise get corrupted and crash while trying to update folders. I ended up re-installing Tortoise, but the ghost lock was still present. From there I had to delete the folder and do a new checkout. Obviously I got really lucky that I didn't have any new changes to commit at the time. Anyhow, not great news, and if anyone has a better solution I'd love to hear it myself. Even using "Break Lock" ie unlock with the force option did not change anything.

Educative answered 12/4, 2012 at 20:21 Comment(0)
S
-1

Clean up, check all check box => This work for me

Sublapsarianism answered 18/9, 2013 at 2:49 Comment(1)
Same as Đức Thắng Nguyễn. Do a "robust" Clean Up.Tref
U
-1

I encountered this problem after these operations:

  1. get lock on folder
  2. modify files
  3. remove files and update folders --> new files downloaded
  4. try to commit or release lock

I finally resolved the problem by forcing the lock again : TortoiseSVN --> Get Lock --> check "steal lock" then commit or release lock.

Ubiquitarian answered 28/4, 2015 at 16:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.