Sundaresan
Sundaresan

Reputation: 9

Need to checkin a file in TFS Work space

Unknowingly i deleted a useraccount from TFS server where he doesn't checkin the checkout file.

Now i am facing the merging issue..

Unable to perform operation on $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js. The item $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js is locked in workspace NCWS054;Suganth.

Regards

Sundar

Upvotes: 0

Views: 437

Answers (3)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30432

UPDATE:

Based on Sundaresan's comment below, resolved the issue via create another branch by eliminating the deleted user.


You can try below ways to unlock the file:

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]

UPDATE:

In your case please try below command: (According to the error message,the file is locked in workspace NCWS054 and Suganth, So, you need to unlock in both workspace)

tf lock /lock:none /workspace:NCWS054 $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js /login:Domain\user,password /collection:http://servername:8080/tfs/DefaultCollection
  • 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 $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js /workspace:NCWS054

    To unlock the whole folder in one shot:

    tf undo $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/* /workspace:NCWS054

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

UPDATE:

In your case, if it is a remote workspace, please try below command:

tf undo /collection:http://servername:8080/tfs/DefaultCollection /workspace:NCWS054;workspaceOwner $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js
  • You can also unlock other users file using TFS Sidekick tools:

    It gives you a graphical interface to do all these commands, which makes it much easier to perform these tasks.

You can also reference this thread: How to unlock a file from someone else in Team Foundation Server

Upvotes: 1

Arkaine55
Arkaine55

Reputation: 548

If you install TFS PowerTools for whatever version of TFS you have (e.g. TFS 2015 you should use https://marketplace.visualstudio.com/items?itemName=TFSPowerToolsTeam.MicrosoftVisualStudioTeamFoundationServer2015Power)

It adds many useful things, including ways to do this through the UI.

With Powertools installed:

  1. Open Soruce Control Explorer in Visual Studio
  2. Right click some file or folder or Team Project and select from the fly-out menu "Find" > "Find by Status..."
  3. Choose to "Display all checked out" or optionally search for just the files checked out to the deleted user. Then click "Find"
  4. Choose/Highlight any User/Workspace/File combination desired and Right click and "Undo..."
  5. Choose OK/Yes to all the prompts confirming you want to do it and informing you what the remote workspace would have to do if you continue.

I've had to use this many times because a developer's machine/hard-drive fails, or a mapped workspace folder was accidentally removed, an unused VM was reclaimed before properly disconnected from TFS, etc. I prefer doing it through the UI vs command line.

Upvotes: 0

Jim Roth
Jim Roth

Reputation: 397

Team Foundation Sidekicks from Attrice (just Google it) are very helpful here. You can find all workspaces and delete the ones that are locking the files you need.

Upvotes: 0

Related Questions