In a previous post I talked about how to use git tfs to extract your source out of a TFS repository, format it for git and finally push that source to Github. This post is a follow up to that prior post and will go a bit further in explaining the exact steps, i took, to do a full end to end migration from TFS to Github (git).
Plan of attack:
- Get and install Git TFS (instructions are on this are in my prior post)
- Get and install the TFS Powertools
- Need to remove all existing TFS bindings from your .csproj and .sln files
The way I found to do this, with a bit of help from my coworker is check out each and every .csproj/.sln file in my source tree.
- Open a Visual Studio Command prompt and CD into the folder where your TFS source is stored
- Run the command -- tf edit /r *.csproj *.sln this command will check out each and every csproj/sln file in your file structure. This MUST be done in the root of your TFS source files.
- Download and run this VS Unbind Source tool I found on codeplex to remove all binding information from the files .
** NOTE **
I noticed after running this that there may be a bug. In all my .sln files the ‘EndGlobalSection’ was removed which caused build failures. I had to manually add them back and then it worked
** NOTE **
- Run the command – tfpt uu /r . this command will revert any files which were not actually edited in order to avoid committing unchanged files.
- Commit the changes to the .csproj and .sln file back to TFS
- Need to export your source from TFS and format it for git. For this you need to use the git tfs tool for this.
CD into the folder where you want to store the new git formatted source and run
git tfs clone http://serveraddresshere:8080/tfs/DefaultCollection $/root/foldername here (of course i removed my company specific settings)
Note, this could take a LONG time depending on how much source you have and how many historical commits. If you don’t care about history do a quick-clone rather than a clone
- Push your source to Github.
- Sit back and relax, you are now using Github rather than TFS for your source storage….
As you can see completely moving from TFS to Github (or git for that matter) is actually pretty easy and can be done with little effort.
Till next time,
Posted
11-07-2012 6:10 AM
by
Derik Whittaker