Transitioning TFS into GitHub Git Repository

Here are transition steps for a solution from TFS over to GitHub using Git Extensions. We will establish a repository on GitHub and create a feature branch.

Step 1. Establish repo in Github

  • On the homepage of your GitHub account, there is a green but that says ‘New Repository’; Click it.
    • Change the Owner to Your Account
    • Enter your Repository Name.
    • Select Private/Public (Your Preference)
    • Add .gitignore for CSharp (Pick applicable language.  This keeps git from version-ing unnecessary files)

Step 2. Establish master code branch (contains current production code)

  • Create a Directory at C:\Git
  • Right-Click on C:\Git and GitEx Clone
    • Repository to Clone: https://github.com/YourAccount/RepositoryName.git  (GitHub given location)
    • Destination C:\Git
    • Everything else blank.
    • (May be prompted for credentials: These are the credentials you log in to github.com with)
  • Copy Source code from your TFS location or wherever into C:\Git
    • May take awhile depending how big code solution is
  • Right-Click on  C:\Git
    • GitEx Commit
    • Stage All (May take awhile)
    • Add a comment then ‘Commit & push’
    • Will do intial commit, (click ok) then bring up push dialog, and wait again… for a while…then Ok.

    Now you should be able to look on the GitHub site and see all the files you just pushed.

Step 3. Establish Feature Crew branches

  • Create branch locally (Don’t need to check it out)
    • Right-Click on your local Repository (ex c:\Git)
      • Git Extensions
      • Enter Branch Name (ex: FeatureCrewBranch)
      • Deselect Checkout after create
      • Create Branch
  • Push FeatureCrewBranch to remote (Branch to push FeatureCrewBranch to FeatureCrewBranch)
    • Right-Click on your local Repository (ex c:\Git)
      • Git Extensions
      • Push
      • Remote origin (Master)
      • Branch to push FeatureCrewBranch to FeatureCrewBranch
      • Add tracking reference

4. Probably will want to compress Git database

  • Right Click on your local repository (ex. C:\Git)
    • Select Git GUI
  • Select compress the db now (Popped up a window for me..will take a bit)
    • If no pop up shows
      • Click Repository in top left
      • Compress Database

It’s not the hardest process, but it is kind of confusing. Please let me know if you have any ideas or clarifications that we can make.

Leave a Reply

Your email address will not be published. Required fields are marked *

StackOverflow Profile