TFS & Git directories?

Dec 5, 2012 at 7:11 PM

Most of the demos i've seen for git-tfs use different directories. So if your workspace for tfs is mapped to

d:\tfs

they would clone tfs to say a directory called

d:\repos

Is it possible to use the same directory structure for both TFS & git or are you going to have problems if you try to do this?

I usually work locally (not remote) but i want the ability to do mini-checkins before i commit my changes to the master TFS server. So hopefully you could map both tfs & git to d:\tfs and not have to worry about maintaining two different source folders and both tfs & git could see any changes i made.

thanks....

Developer
Dec 5, 2012 at 7:58 PM

Interesting!  It's definitely expected that you have your git-tf repository in a location that's not a TFS working folder mapping.  In fact, right now, Bad Things will happen if they overlapped.

I see the use for this, though, and I like it.  Unfortunately, a lot of the people working on git-tf have been sidetracked by our day jobs so we can't make this a high priority.  (Of course, if one were particularly motivated to try to make these changes, I'd be happy to point you in the right direction.)

Lacking support in git-tf, however, if you want to do something like this - you can probably just do a TF get, add that to a git repository, then commit away.  At some point you'll need to reconcile those back up to TFS, of course, so if you're using a server workspace you can do tfpt online, and if you're using a local workspace you can just hit it with a big refresh to pend those changes.

I admit that this isn't the most beautiful strategy - but I've done something like this before with a limited amount of success.  :)

Dec 7, 2012 at 2:19 PM

Thanks for the reply. Ya it happens to the best of us. There are always things that are more important right :). I believe the git-tf is coded in java. Maybe if it was in .Net i would roll up my sleeves and dive in but i'm not crazy about diving in with java now :). Anyways thanks for the possible workaround.

Dec 7, 2012 at 7:03 PM

What about following scenario ?

Ability to have TFS workspace d:\tfs but create is as a --bare git repository (is it possible to create it bare when cloning it from TFS ?). The use for this is that by creating it --bare multiple members in the same team could work for example on same feature branch featureX that would be backed up by the bare repository (the same repository where TFS pulls and checking would be made!). When featureX is ready it would be merged in the *master* branch of TFS and checking in TFS would be made. That should save a lot of issues when working on features with team members because creating branches on TFS server is problematic/not recommended for so many reasons.

 

Without this possibility to share TFS folder with a central git repo people working on the same code can not share, and where is the usefulness of collaborative working  that only git enables ? If you have thoughts abut this or how can we achieve the objectives mentioned please let us know.

Thanks..

Developer
Dec 7, 2012 at 7:06 PM
Edited Dec 7, 2012 at 7:10 PM

There is a  --bare flag to git tf clone.

My recommendation, however, would be to nominate somebody to be the person who handles integration between this group git repository and TFS to handle any conflicts between TFS users and git users.  This person would git-tf clone a repository, then publish that repository for git users.  The integrator could then take changes from the git users and, when ready, push them back up to TFS.

This person would need a non-bare repo in order to handle conflict resolution that might arise during this integration.

Dec 7, 2012 at 8:24 PM

What I was thinking for using is this

1. Clone remote tfs repo using git tf clone - - bare in folder bare

2. Map folder bare to a Windows drive for example x: this is shared to other computers team members

3. Computer 1 where shared folder is present creates a git working folder where it creates a so called clone by doing

Git init

Git add remote origin file:///x:

Git pull origin

4. Computer 2 clones the Central git repo using same techniques as step 3 after mapping the shared folder to x:

5. Commits are made by pushing to Central git repo

6. When integrator decides that a merge to master tfs is required he merges changes in working git folder to master branch corresponding to tfs repo. Than he has the option to use git tf checkin or is it possible to use directly visual studio integration with tfs so that it mentions there reviewer for example?