简体   繁体   中英

Git and tfs: can I have only the central repo communicate with tfs?

I'd like to move my team from using TFS for version control, to git.

Is there any reason I shouldn't do the following:

  1. Create a central git repository using git-tfs
  2. Have each developer clone the central repo, pull from, and push to it
  3. And then only update tfs from the central repo?

Thanks!

Create a central git repository using git-tfs

The can be dangerous, as TFS has a central repository with everything in it.
The resulting git repo can end up being a huge one (not easy to clone around)

I would recommend making several git-tfs in order to create several smaller Git repos.

Due to the fact that the interaction in Git and TFS, git-tfs, is not perfect (due to the fact that a main caracteristic of Git is that you can't modifiy a commit once created and that git-tfs doesn't work with bare repositories), putting a central Git repository in front of TFS is not straight forward...

I imagine all your team will use this worflow otherwise, you could stop thinking to the idea to do this (due to merge conflict you will have to manage)...

Because git-tfs doesn't work with a bare repository, you will end up with, in fact 2 git repositories that you should sync. The 1st one where you push ( a bare one) and the 2nd which interact with TFS (not bare where you use git-tfs).

Then, you've got 2 options : a) you accept to have only one commit on TFS even if you have multiple git commit (use git-tfs 'checkin' command) b) you want to replicate each git commit in TFS (use git-tfs 'rcheckin' commit)

The first case a) is not the better but is the easier to solve with some scipts and git hooks because there is only always new git commit to sync between the 2 repositories.

The 2nd case b) is, for me, the only acceptable but is much more harder to solve because when you sync git repository with git-tfs 'rcheckin' command, for each git commit, a new one is created and the sync script will be much harder to write (I don't even know if all the merge conflict could be resolved). I begun to do write these script but stoped because it doesn't worth the effort (especially now that Visual Studio 2012 resolve the reload problem where every time the solution files was reloaded). If you want to do that, the scripts in the post below are a good step from where to begin...

In conclusion, I think it doesn't worth the work to do that. You could find a local workflow with git-tfs which is quite easy and don't need a git central repository...

But if you still want to have a Git central repository, you could check this post ( http://sparethought.wordpress.com/2012/08/23/my-environment-for-day-to-day-work-with-git-tfs/ ) of an hybrid way (commit to TFS and fetch from git) that seems works.

Team Foundation Server 2013现在支持Git作为Team Project的源控制存储库,而Visual Studio Tools for Git提供嵌入Visual Studio的Git访问( 2012年的加载项,随2013年发布)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM