git-tf tells on linux me “Could not lock” when checking in; how can I fix it?

194 views Asked by At

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.

2

There are 2 answers

0
Ramon van der Werf On BEST ANSWER

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.

1
Cece Dong - MSFT On

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.