Search code examples
gitversion-controltfsgit-tfs

Use git-tfs with multiple Git-users


The official SCM here at work is TFS. I use git-tfs to be able to work. Other devs here at the local branch of our company use StarTeam for local development branches (yes, there are SCMs out there worse than TFS). Now, some of us thinking about migrating from StarTeam to Git for our local development.

What is the best way to use git in combination with tfs for multiple users?

The best idea I had:

  1. One central server holds a 1:1 copy of the TFS repository (via git-tfs, synced per script every hour or so)
  2. Dev pull from this server .
  3. Dev creates branch to implement feature.
  4. When done, dev commits via TFS and deletes branch.
  5. Dev pulls his changes via step one into his master branch.

Might this workflow work? Does anyone have experience how something like that can be set up?


Solution

  • The current solution is basically the same as I outlined above. The main restrictions:

    • My collegues are not used to console and try to avoid them as much as possible. CLI-applications are a no go (sadly)
    • TFS is still "upstream" (it's not a build process I want to keep alive)
    • The history have to be correct (who commited what and when)
    • Every developer have to be able to commit every time

    So... :

    • The main repository is synced every 10 minutes by git tfs fetch and the branches are reset to tfs/branchname
    • Commits into the official branches (copies of the tfs-branches) are forbidden.
    • Checkins into TFS are done by git tfs rcheckin --no-merge (wrapped in a plugin for GitExtensions).
    • :%s/tfs/TFVC/g

    We are running this setup for some months now for 3 repositories and multiple branches. My colleagues get used to git and this workflow within a short time - a question every now and then but it becomes less and less. I'm moderatly surprised, how well this had worked out.