简体   繁体   中英

Connecting or mirroring a VS2013 TFS project to git

I work on a project where the source code is hosted in the company's (non-git) TFS -- I get all the updates via TFS and also have to commit my code to their TFS. Now there are occasions when I can't login to the company VPN for quite some time, and thus don't have access to the TFS, but I'd still like to preserve my local changes.

A great way to do that would be by connecting/mirroring the same sources to a git server (which I would setup locally myself). A second benefit would be the possibility to work on the sources from several other systems that don't have access to the VPN/TFS, but could access the git server.

I need to retain the VS/TFS workflow/integration/features: commits, pulls, merging, shelving, annotations, code review requests, work items etc.

I don't need to automate the process or VS to "know" about git, using the cmdline git to update the git repo after a TFS get latest files from the server is fine; same goes for manually pulling changes out of the git repo and then committing the pending changes to TFS in VS.

Edit/update for clarification: I would like to keep the VS/TFS integration/workflow as is, as I need to access pretty much all of the TFS features within VS. If at all possible, the TFS versioning in VS should not be changed in any way. The additional git repo should be as separate as possible. Ideal solution would be if I simply tell git that the exact same source files are git version-controlled. But I'm a bit afraid that this will break other one or both TFS and git, when they both overwrite the same files.

Is this scenario possible in some way, without breaking Visual Studio's TFS managing, even when pulling changed sources out of git into the TFS managed solution?

Check out git tf here: https://gittf.codeplex.com/

It was made by Microsoft and allows you to push directly from a local git repository to a remote TFS source control server. You need to grab one branch into a local repo, but since Branching and Merging requires a server connection in TFS anyway, that doesn't feel like a big setback.

Using the Visual Studio Tools for Git (included in VS2013, free download for VS2012 ) or the 3rd party Git Source Control provider (works in 2010 as well), you'll retain many of the features in Visual Studio you're already used to, but you will need to drop to the commandline to push your changes back into TFS.

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