Today I pushed two new git-tfs goodies: bootstrap, and checkin policy override.

checkin policy override

The checkin policy override support is pretty straightforward. If you try to check in to TFS…

git tfs checkin

…and it fails with some messages about checkin policies (e.g. no associated work items, or the code analysis policy can’t run), you can now override the policy failures. Of course, the best fix is to comply with the policy. For example, if you need to specify an associated work item and provide a checkin comment:

git tfs checkin -w 12345 -m "My awesome code has an awesome checkin comment."

But, if you really need to override the policy failures, you can now do it:

git tfs checkin -f "Policy override because of X" -m "Normal checkin comment."

Of course, you can use checkintool to do all this in a GUI.


The other change was the addition of a bootstrap command. This is useful if you create a TFS clone and share it with a colleague who then needs to interact with TFS. While two identical invocations of git tfs clone will produce identical repositories, git clone is always going to be faster than git tfs clone. So, I would guess that most people who want to collaborate on a TFS project using git will benefit from this command.

The old workflow for this was:

[user1] git tfs clone http://blah/blah/blah $/blah
[user1] cd blah
[user1] git remote add shared git@someplace:shared/repo.git
[user1] git push shared master
[user2] git clone git@somplace:shared/repo.git
[user2] cd repo
[user2] git tfs init http://blah/blah/blah $/blah

At this point, the users can collaborate with each other using git, and they can both do TFS checkin or fetch. For the best workflow, both users need to type in the exact same path. An extra ‘/’ or a capitalization change will keep git-tfs from matching up the TFS remotes, and it will refetch things it doesn’t need to.

So, the bootstrap command replaces the last ‘git tfs init’:

[user2] git tfs bootstrap

This will scan HEAD’s history for checkins with TFS metadata, and configure one or more TFS remotes to match. If you already have the remotes configured, it will just tell you what it found.