Mar 3, 2011

Git-TFS Recent Improvements

If you like using Git for local development work but work in a team environment where TFS in use then you’ll be glad to know that the git-tfs project has been progressing well since I last posted about it.

The best new feature is that now you can do a checkin direct from git-tfs instead of needing to shelve, and then check in via team explorer, making the whole process much, much smoother.

Here’s an example of how things now work (assuming you have already cloned the TFS repository)

image

When you run the git tfs ct (aka checkintool) command, you will see the check in dialog so you can commit the changes.  Note that this is only supported with TFS2010.

image

I’ve got a small change in my fork which will hopefully be pulled in to the main project shortly that pulls the commit messages from git and populates the comment field of the check in. UPDATE: This is now included in the main project so use spraint's version.

Once the check in completes git-tfs then automatically pulls the changeset from the remote TFS server and merges the change locally to save you having to remember doing that yourself.

image

image

Finished!  Now we can get back to our normal development flow. This is so much easier.

The advantage of having the checkin tool is that we can also associate our commit with work items in TFS as well as dealing with check in policies.  This is excellent!

If you don’t want to use the check in tool UI, then you can use the git tfs checkin command and supply the –w option to associate to a work item.  Policy failures should result in the checkin failing.

Note that for now, you will have to build git-tfs from source to get this functionality, but that shouldn’t be a problem for anyone wanting to use this tool :-)

2 comments:

  1. Installing git tfs just got much simpler -
    cinst gittfs
    Here it is in action: http://ow.ly/i/cUfu and http://ow.ly/i/cUfw

    ReplyDelete
  2. TFS is quite aggravating , I just gets frustrated whenever I have to branch or combine or personally look through a file to modify it. Git-tfs is great but it only resolves a small sector of the problem, still better to have something than nothing.

    ReplyDelete