Allen
Allen

Reputation: 11

How can I delete a file lock that is blocking the deletion of a repo?

I'm trying to delete an abandon repo in Azure DevOps 2019. Getting the error:

Unable to perform operation on (repo)...
The item (file) ... is locked in workspace ....

Note, the file doesn't exist in the repo. It only seems to exist in the workspace.

We have tried using the 'tf.exe workspaces' command but no luck.

I have admin rights. Is there something I can do to cleanup this lock?

Upvotes: 1

Views: 671

Answers (1)

Felix
Felix

Reputation: 1152

You can try below ways to unlock the file:

tf lock /lock: none Please see Lock Command for details: To use the lock command, you must have the Lock permission set to Allow. Having the Unlock other user's changes permission set to Allow is required to remove a lock held by another user if you do not have Write permission for that user's workspace

tf lock /lock:none /workspace:workspacename [/recursive][/login:username,[password]] [/collection:TeamProjectCollectionUrl]

tf undo The undo command removes any locks on the items. See Undo command

To unlock individual files run the command below in Visual Studio Command Prompt:

tf undo "file_path" /workspace:workspace_name

e.g.:

tf undo $/S/B/ABC/dotNET/Symphony/Tools/xyz/abc/Abc.dll /workspace:Houst01

here it will unlock Abc.dll which is inside abc folder.

To unlock the whole folder in one shot:

tf undo $/S/B/ABC/dotNET/Symphony/Tools/xyz/abc/* /workspace:Houst01

here it will unlock all files which is inside abc folder.

Upvotes: 1

Related Questions