I'm using git-tf to push to a TFS project. 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?
Why it happens
With standard TFS usage, you're only checking in one commit at a time. But with Git, you could have a series of commits that you push all at once.
Because of that, git-tf strives to keep your set of commits atomic. If someone checks in while you're checking in, the history can get mixed up; it won't be merged properly.
To prevent this, git-tf temporarily locks the entire source tree while it checks in. It can't do this, though, if somebody else has parts of the source tree locked already.
How not to fix it
You'll see the --no-lock argument recommended in some places:
This is not a good solution. It ignores the potential scrambled-history problem instead of solving it.
How to fix it