Merge from VisualStudio Online to local TFS and back? - tfs

Have an in house TFS server that employees use (using TFVC) and third-party contractors that are using VisualStudio Team Services (aka Visual Studio Online or VSO) (also using TFVC). Need to keep the two synced; projects in VSO get merges from check-ins from TFS and TFS get merges from VSO. The TFS instance has many dozen projects and the VSO instance has two or three of those in TFS.
Any suggestions appreciated.

While there are a few tools that can "sync" between different TFVC instances, it's very hard to keep the flow going and you often run into merge conflicts and other problems. The TFS Integration tools were an official solution from Microsoft, but those have been deprecated.
Given that you're on TFS 2017 and VSTS, I'd highly recommend switching to Git repositories. Git was made to handle scenarios like these, to have multiple hosts that need to share the history and from which you need to be able to sync sources across.
Both TFS 2017 and VSTS can host the repository for you and it's relatively easy to setup CI builds that sync the sources between branches on both instances to trigger pull requests.

Related

Move code from TFVC on TFS 2010 to TFVC on Azure DevOps Server

I have some projects on TFVC source control on TFS 2010. I want just to migrate the source code from TFS 2010 to TFVC on Azure DevOps Server.
I don't want to process an upgrade of the entire collection to a newest version. I Just want to transfer my code with history.
I tried Git-TFS. I cloned my repository on TFS 2010, but I don't know how I can update the remote URL for TFVC repos and push on Azure DevOps Server.
Any ideas how I can do it? Or other tools that I can use?.
In the case I decide to migrate without history how can I do it?
Thanks.
git-tfs is a two-way bridge between TFS (Team Foundation Server) and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.
If you want to move code from TFVC on TFS2010 to TFVC on Azure DevOps 2019 and keep history.
You have to do the upgrade process of entire project collection.
In the case I decide to migrate without history how can I do it
You could just create corresponding new team projects and workspaces. Pull down your source code from your TFS2010 workspaces/projects. Copy and paste source code files/folders in new workspace. Then check in them back to Azure DevOps Server 2019.
We advise you keep preview TFVC repository of 2010 online but read-only to view history.
Same with Azure DevOps Service, hope this helps.
Disclaimer: I'm the last maintainer of the git-tfs tool (even if I no more work on it)
Git-tfs could be used to migrate from TFVC to git (with history and branches if your history is not too complex).
But in no way it could be used to push this history to another empty TFVC project.
So don't expect something from here.
Fun fact (not so fun for you) :
To prevent regression developing git-tfs, I created a TFVC project on Codeplex used to run smoke tests in a Continuous Integration job.
When Microsoft decided to close Codeplex, I contacted a guy working in the source control team inside Microsoft to help me migrate from Codeplex to Azure Devops (at the time called VSTS) which is the problem you try to solve.
I don't know if they put a lot of effort into this but no one was able give me a solution. The only thing they think about was to use git-tfs, that I confirm you is not able to do it!
That could give you an idea of the problem you're trying to solve...
Ps: that also show that TFVC is not an enough flexible source control and their is a much higher added value to migrate to git (like nearly everyone is doing it...)

How to integrate TFS 2015 and VSTS

We need to synchronize several projects hosted on Visual Studio Team Services with our on-promise TFS 2015 Update 2. The ultimate goal of TFS is to have CI/CD happening within company for all external projects. However, we don't want to interrupt developers for whom using VSTS will be better choice then TFS.
However, I can't find any solution for TFS to use VSTS as a repository, though TFS can use Git. Maybe, I should look differently on this case. Does anyone know any possible solution?
You'll need tools to migrate between on-premise TFS and VSTS, like:
TFS Integration Tools
OpsHub Visual Studio Online Migration Utility
A useful blog for your reference.
I suspect that setting this up is going to be tricky or it's going to cost you.
The free OpsHub migration utility isn't going to help you in this scenario so you're looking at a commercial product like :
TaskTop Sync or OpsHub Integration Manager
but I haven't used them in this scenario so can't comment on either.
TFS Integration tools would probably do the job but you've got some work to do to get them working and it's not pretty. I have them setup at the minute to sync Work Items from TFS 2015 to VSTS for testing purposes and it works okay. My blog on setting them up with VSTS/2015 is here
Would you not consider doing your CI/CD directly from VSTS rather than an on-premise TFS? You could still have the build/release agent running on-prem and you could lock down permissions for your external devs so you control all the build and releases and any other projects.
Git would be a simpler way of merging code between VSTS and TFS2015 but that assumes you are using Git on your 2015 projects and I believe it would be manual process for someone to do this (someone may be able to comment on a way to make this work)

Can I utilize two different versions of TFS to manage source code?

I am not familiar with TFS, however the scenario that I will be coming across is that I will have a branch of source code stored in Visual Studio Team Services (was TFS Online) and locally I will be running TFS 2008.
Would there be any issues pulling the code from Team Services and merging with TFS 2008?
You won't be able to bind the code (solution and projects) to 2 different TFS servers. If you're using the online version of TFS what reason would you have of also trying to store the code in a local repository?
You definitely won't be able to merge the code between the different servers. TFS is a centralized version control system and merge operations need to be handled and tracked by the server.
You could theoretically Manage the code in one of the TFS servers (i.e. have the solution bound to TFS online) and manually manage the code in the other server. However TFS 2008 only supports local workspaces which means that it will make files read only if they are not explicitly checked out. This will cause you no end of pain.
Even if you did it the other way round (made the local TFS server the "master") you will almost certainly create yourself a load of problems as TFS simply isn't designed to be used this way
Also TFS 2008 is pretty ancient and unsupported.
EDIT:
The typical TFS workflow is.
Create a development branch on the server.
"Get" the code to a local folder on your dev machine (called a workspace).
"Check out" the files you need to modify from your branch or "Add" new files as needed.
You should regularly "check in" files to your branch to make sure your changes are saved on the server.
When your changes are complete then "merge" the code from the development branch back to the Main branch.
The code is stored and versioned on the server, but your changes are made on your local machine. To interact with the server you use the Team Explorer plugin in Visual Studio. Modern version of Visual Studio have Team Explorer built in.
If you're using the online version of TFS then you'll want to use Visual Studio 2012 or above.
If you're planning on Forking the code and do not plan on committing your changes back to the server, then you're probably better off using something like Git. You could use Git-tf or Git-TFS to pull changes from TFS and then that would make merging a lot easier and you could use your local Git Repo to manage your own changes

Sharing code between 2 TFSVC repositories with git-tfs

I have 2 different TFS repositories (one using Visual Studio Online and another using my own local on premise TFS instance) which I want to keep in sync using git-tfs. How do I need to set things up so that I can work locally in git and push changes up to both repositories? Please note both TFS repositories are using TFSVC.
As the main developer of git-tfs, believe me, that's not possible...
Git-tfs can only manage one TFVC repository.
Short answer: Not support.
If you want to sync Visual Studio Online and local TFS. You can use the TFS Integration Tools to setup a unidirectional sync, that should allow you to ensure that a TeamProject on your local TFS system remains in sync. However, they are complicated to setup and will be painfull to run. And There are commercial options that are ridiculously expensive, like OpsHub.

TFS Sparse checkout local workspace

Is there a way to "sparsely checkout" a local workspace in TFS 2012? We currently use SVN and are investigating TFS 2012. Specifically, I don't want my entire collection to be downloaded to a developer machine. We branch to provide isolation among teams and products. I'm hoping that we can selectively choose which items in the branch are downloaded locally.
You can map various parts of your source tree using different workspaces to achieve some of the effect that you're looking for. We use this to separate components in our build system. Workspaces are configured by client machine/by user.

Resources