TFS - Branching just one project in a solution - tfs

I have solution in VS 2017 contains 4 projects - asp.net project, windows form project, SSIS project and console project. Now in WinForm project we are going to add lots of new features which we plan to release after 9-10 months, so I am thinking to create a branch for WinForm Dev branch. Here is my solution and folder structure...
MySol
MySln.sln
ConsoleApp
WebApp
WinForm (Main)
WinnFormDev (Branch)
SSIS Pkges
I successfully created Dev branch but when I open a solution in VS, I don't see my Dev branch so I can't make any change. My goal to is work in Dev branch and I may have to make some changes in WinForm main branch and other projects during 9-10 months development, I will always merge those changes in WinForm Dev, once all new features are added in Dev branch (after 9-10 months) I will merge into main and get rid off Dev branch. Is this possible? or I have to branch whole solution?

You can make changes in the Dev branch on local.
For example, I have two branches on my side:
In Visual Studio, you can first clone the repository, and then select the Dev branch here:

Related

How do I enable Git for Visual Studio/Team Server 2013

We have a Team Project we created in 2013. The web site of the project allows Git Repos to be created, but in Visual Studio 2017 the Git repos we created are always Offline and exhibiting other odd behaviors (loading TFVC's interface in Visual Studio even when connecting to a Git repo within it for example). I used Fiddler to check out the traffic and noticed that this particular project is missing the SourceControlGitEnabled = true flag. A project we created a year and a half later DOES include the SourceControlGitEnabled flag and works properly.
Is there a TFS Team Project setting we can alter/enable or do I have to create a new Project with Git as the repo and migrate everything to it?
When you create a new repo in the Team Project in TFS2013, there should be a warning as below:
Note that some versions of Visual Studio will only provide full Team
Explorer integration with a repository that has the same name as the
team project. Users may need to manually clone this new repository to
use it in Visual Studio.
This maybe the limitation of TFS2013 with GIT, either manually clone this new repository to use it in Visual Studio or create a new Project with Git as the repo and migrate everything to it, both should be work.

git filter in on premise TFS 2015 Update 3

If the repository is git behind our TFS project there is no way to filter the repository by source folder. The build always pull the whole repository. We have multiple solutions in the TFS project we want to build separetly. We can do it, but it is slow because we cannot filter the source folder to download.
The other problem that we cannot add folder to CI trigger. So all the projects will be build after a push in any projects.
I know that the Team Services already support path filters for git repository. But does anybody know some workarounds for this problem for on premise TFS 2015 Update 3?
There is no workaround for this on TFS 2015 update3. Unless separate your components into different repositories. Multiple projects must be in their own repository. All dependencies is a project by it self and can be handled as NuGet packages. Then your whole solution would not break if you change something in the dependency project and using CI trigger.
This feature will ship in TFS 15 and is already available on VSTS
https://www.visualstudio.com/en-us/docs/build/news/2016#june-14

Editing TFS release management definitions

In TFS 2015 update 2, is there a way to copy release definition steps from one environment to another, or from one def to another, or within an environment (to make a clone)? What about multiple selection? Drag and drop only works within an environment, and Ctrl+drag doesn't seem to be supported.
In TFS 2013 Windows-based release client, it was perfectly possible.
I don't have TFS 2015.2 to test your scenario, but I have tested in TFS 2015.3. In TFS 2015.3, you can clone environment, but can't clone release definition. Check the screenshots below:
I also tested in the newest TFS15, you can both clone environment and clone release definition. Check the screenshots below:
So, you can consider upgrading your TFS, then you are be able to clone environment.

Can you merge two branches in Visual Studio Online?

At the moment, from what I know, if you have two branches, you have to have both branches mapped to locations on your machine and Visual Studio (or TFS within Visual Studio) will download the latest version and merge the changes locally and then you have to check in the other branch. I would like to be able to merge this branch with this branch with only having one branch mapped locally?
The purpose of this is that we have a development branch, a test branch and a release branch and we are merging changes from the development branch into the test branch and building it on the server which is then deploying it on another server. All this is working great but the test (and release) branch must be mapped on the machine of anyone trying to do this otherwise it won't work.
Ideally I'd like to be able to log into Visual Studio Online and do all the merges, builds and deployments there rather than on my development machine at all - is any of this possible? And if so, how please?
Not entirely sure this is something support-able by the TFS product, actually. Merges tend to need at least a minimal amount of human interaction whenever there is conflicts (and even in the cleanest merge relationships conflicts can and do arise).
However, you can do this on the build machines if you wish by performing the merge just before the build occurs and if the build succeeds, checking the merged changeset in.
Using the Pre- and Post- build script functionality in TFS build, you could try to do something such as the following...
Pre-build script would include commands such as:
tf merge $/ProjectRoot/Branches/Dev $/ProjectRoot/Branches/Test
tf resolve $/ProjectRoot/Branches/Test /r /i /auto:TakeTheirs
Post-build script would include:
tf checkin $/ProjectRoot/Branches/Test /r /i /comment:"***NO_CI*** [AutoMerge]"

How do I migrate source code from one TFS server to another?

We have a TFS 2005 (I think) were we host some code in one domain. Now we would like the customer do host the code by itself and they have bought a new version of TFS 2010. How do I migrate the code from the old server to the new one. We don't care about history at this point since we will have the old system running for at least one year if something critical happen.
What I have done so far is the following:
Create a master branch in the new version and copied the old version to the new version with no problem.
Created a development branch from the master branch.
Now I would like to migrate the development code from the old tfs to the new tfs and this seems complicated.
I first thought it would be as simple as checking out the whole development branch in the new TFS, delete all the files and just paste in the files from the old development branch. But that is not the case.
Maybe there are a simple tool I could use instead?
I know you said that you don't care about history but would you take it if you could get it for free? The best thing to do here is an upgrade, or an import of a Team Project Collection. If you take backups of all of your 2005 databases and restore them on the TFS 2010 data tier you can then run "tfsconfig.exe import". This is the most supported way to get your data from one server to the other.
Follow these steps in the new server:
Create the Master Branch, check-in.
Copy the sources from the old server in the local workspace of the new server at the Master Branch location
Check-in to commit the sources to the new server.
Create the Dev branch from the Master Branch using the latest changeset of the Master branch. This will replicate the whole structure of the Master branch to the Dev one.
Exit Visual Studio
Using the Windows Explorer, delete all the content of the Dev branch in the local workspace of your new server.
Copy the sources from the old server of the Dev branch in the local workspace of the new server at the Dev branch location.
Use the TFPT.EXE ONLINE command of the Team Foundation Power Tools to simulate an offline/online switch that will create the pending changes of the new content of your Dev branch (the files you copied from the old server). Be careful you have everything the way you want it to be in TFS. The command is something like tfpt.exe online /adds /deletes /modify /recurse . (check the help of the command)
Check-in.
Then you'll have the relationship between both branch and the content you want in both.
Have a look at TFS Integration Platform

Resources