Derik Whittaker

Syndication

News


Moving from TFS to Github – Steps we took to do the migration

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.

    1. Open a Visual Studio Command prompt and CD into the folder where your TFS source is stored
    2. 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.
    3. 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 **

    4. Run the command – tfpt uu /r .  this command will revert any files which were not actually edited in order to avoid committing unchanged files.
    5. 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
Filed under: , ,

[Advertisement]

Comments

Ryan Cromwell wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 11:35 AM

So why not use git-tf or git-tfs to clone the TFS repo as a Git repo, then push the repo to github?

Jeremy Wiebe wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 11:46 AM

@Ryan - he did use 'git tfs' (the non-MS one).  But part of the move requires removing the TFS bindings as they're no longer needed or wanted in git.

@Derrick - Why did you remove the bindings and then check back into TFS?   Why not 'git tfs clone' and then remove bindings and push to github?

Benny Thomas wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 2:13 PM

This felt unnecessary difficult.

All we did to do the same was cloning the tfs repository.

"Disabled" the TFS explorer in Visual Studio.

Open the cloned solution in Visual Studio and removed the bindings when Visual Studio asked if it should remove them.

Afterwards:

git add .

git commit -am "Removed TFS bindings"

removed the old origin

git remote rm origin

added the github repository to the git repository with the cmd:

git remote add origin github.com/.../repository.git

refreshed the repository

git remote  update

took a merge and then pushed the repository up.

git merge origin/master

git push origin master

Martin wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 2:56 PM

How did you deal with the branches in TFS?

Derik Whittaker wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 3:14 PM

@Jeremy,

I removed the bindings and committed back to TFS because have have a number of branches which were NOT going to be migrated via git-tfs and i wanted to remove those bindings so each branch could pull that change.

Make sense?

Derik Whittaker wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-07-2012 3:17 PM

@Benny,

we have about 15 sln files and around 100 proj files so your approach would not work in a quick/easy manor.

Derik Whittaker wrote How we handled our branches during our TFS to Git migration
on 11-10-2012 1:02 PM

In my prior post I documented the steps and processes that OUR team took to move from hosting our source

Dave Schinkel wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-14-2012 12:02 PM

Great stuff, more articles like this to get people off TFS is appreciated.

Dave Schinkel wrote re: Moving from TFS to Github – Steps we took to do the migration
on 11-14-2012 12:06 PM

@Ryan, sure you could use git-TFS BUT I ask you who wants to layer Git or work with another system that's a pile  "crap" (TFS) in addition to just using Git alone?  Just suck it up and do the migration and say adios to TFS (IMO company should just take the cost hit to migrate via manpower ours, and remember Git is free and you'll save money there to kinda pay that back by saving $$ in the future) and move on with a lightweight powerful source control that doesn't give you hell on earth and does not cost you anything.

buy discount viagra wrote re: Moving from TFS to Github – Steps we took to do the migration
on 02-02-2013 3:30 PM

KpBJAz Really informative post.Much thanks again. Want more.

buy viagra online wrote re: Moving from TFS to Github – Steps we took to do the migration
on 02-03-2013 4:56 AM

xnPZIL Thanks for the blog.Really thank you! Great.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)