0

I'm using git-tf to push to a TFS project on lin. Sometimes, when I try to check one or more commits into TFS, I get a message like this:

Connecting to TFS... Checking in to $/MyProject: 0% git-tf: Could not lock $/MyProject

What does this mean? What's keeping me from locking? And how can I fix this?

I found out that a workspace has locked the project, but I don't know which, and I don'w know how to recover this.

A search on internet hints me to all kind of Windows dependent fixes, but that does not help me on a linux system.

So, although this question appears to be a duplicate, it is more meant on how to fix the issue on Linux.

Community
  • 1
  • 1

2 Answers2

0

The first thing need to be solved is finding out all locked files under $/MyProject, then unlock them.

There are several tools available on Windows platform, like TFS Powertool and TFS SideKicks, as you have read on other cases.

I can't find any existing tools on Linux to get all locked files, so tfs command lines would be one solution. You can use Status command to list all checked out files under $/MyProject, the command should be similar to(I don't have a Linux system to test, you need to verify on your side):

tf status $/MyProject /user:* /recursive

Once you find out the checked out files, use Lock command tf lock /lock:none to unlock the files.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Thanks, but apparently the files were locked in a workspace that had been removed. For git-tf one can safely remove the workspace, as this does not harm functioning. The temporary workspaces are only initiated upon commit (and maybe pull). These workspaces are removed afterwards. – Ramon van der Werf Jul 12 '16 at 20:42
0

Eventually I found out, that this can be fixed by removing the workspace that locked the repository.

tf workspaces -remove:myLockedWorkSpaceName

However, after that it was still locked remotely. Eventually, I had to connect to the repository via visual studio from a windows machine.

There:

File->Source Control->Advanced->Workspaces

Toggle "remote workspaces"

Select the git-tf-##### workspace(s) and remove them.

After that, everything works again.

Somehow, I still don't know how to do this from a LINUX command line.