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.
Related
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.
I found articles on GIT back up and restore but I did not find any on Microsoft TFS Scheduled backup for GIT version control.
This document describes on how TFS's traditional versioning can be scheduled for automatic back up. Configure a backup schedule and plan for Team Foundation Server
However, I did not find any link where I can read that "GIT repository is also included in schedule". I am not a TFS expert and I do not have access to TFS server to verify in person. So any help is appreciated.
The tutorial you are refer which is Scheduled Backups tool. It' a build-in tool on the Scheduled Backups page in the TFS Administration console.
It' the whole database back up not only referring to source control, but also work items, pull requests, builds, test plans or anything else that the service offers.
As a limitation, you need both an administrator for TFS and a member of the SQL Server System Administrators group.
And no need to to verify in person, it's under SQL server, when you want to use the backup, just restore the database.
If you are actually using the online VSTS . For now there is no build-in tool and got a uservoice:
Provide a backup service for Visual Studio Team Services
https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/5339461-provide-a-backup-service-for-visual-studio-team-se
However if you just want a git repository(source code) back up, you could use some 3rd-party tool to achieve this:
We use the VSO Rest API to query our VSO account and get all the data
we need. Since in VSO you can only have one Team Project Collection,
we retrieve all the team projects of the default collection. Each of
these team projects can have multiple repositories that need to be
backed up. A folder is created for each team project and saved to a
location on disk that can be configured in the app.config. When the
team project folder is created, the task loops over each repository in
the team project and creates folders for each repository.
Source Link
You can also fork it on GitHub here. Certainly, you should also be able to use this for on-premise TFS also use the API, just need to change some part.
TFS is implemented the way to keep Git repositories in the SQL Server database, too. Thus, when you follow the instructions from the article you reference, the source code will also be included in the backup, no difference whether it is TFVC or Git.
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
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.
In our current setup, we have a top level TFS project and all the projects within in as separate folders with their Dev and Main branch.
To start trying VS Team Services, I am looking into migrating just a folder(Project) from TFS 2013 on-premise project to Team Services. Can I do that?
The options I am getting are to choose the project collection but not the folders within it? Is there a workaround for that.
It is not. You need to migrate everything as is.
If you want that level of control you need to use the TFS Integration Tools. They are a lot more configurable, and complicated to boot.
I would recommend that you move with only the head/tip.