Can a branch be made from a previous changeset? - tfs

I need to create a branch at a specific Changeset in TFS. Is this doable?
For example, I have changeset 1528 that was the last check in on my project. But I want to branch from changeset 1487. Can this be done?
If so, how?
Note: I am using TFS 2008

Yes. When a branch is created you can choose the historical point in time when it takes effect (date, changeset, etc).
See Visual Studio TFS Branching and Merging Guide for some great information on recommended branching practices.
Or How to: Branch Files and Folders (MSDN) for more explicit instructions on getting this dialog up to create a branch.

Visual Studio 2010 and later added support for this functionality:

Related

Why did a TFS merge auto-merge a file, instead of prompting me to manually merge the file?

We are currently using TFS 2015 for source control and project management. We're also using Visual Studio 2019. The team I'm on has a main branch in TFS, with branches off main for development isolation. Today I merged the main branch into my dev branch. During the process TFS/VS 2019 informed me that there was a conflict in one file, Proficiency.cs. However, TFS auto-merged the file. After I checked in the changes, I looked at Proficiency.cs. It was wrong, the version in my dev branch didn't have the changes that it should have from the main branch.
Why didn't TFS give me a chance to review the conflict? Is it because we're using TFS 2015? Or is there some step or configuration in VS 2019 I should set to allow me to review the conflict?
By default the system automatically attempts to AutoResolve All conflicts. To change the option, from the menu bar choose Tools, Options, and then in the Options dialog box, navigate to Source Control, Visual Studio Team Foundation Server. Clear the Attempt to automatically resolve conflicts when they are generated checkbox.
More details, check documentation below:
https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/resolve-team-foundation-version-control-conflicts?view=azure-devops

What is the easiest way to rename a shelveset in TFS?

I'm trying to rename a shelveset. The only way I can think of to do it is:
Unshelve it (uncheck Preserve shelveset on the server)
Gather all the changes into Included Changes (and exclude everything that wasn't part of that shelveset).
Re-shelve it with a different name
Is there an easier way?
(we are using TFS Version 15.117.26714.0)
What is the easiest way to rename a shelveset in TFS?
Personally think the method you think is the simplest or most direct.
Since TFS teams Suggested on their old user voice forum(Closed now):
Visual Studio Team (Product Team, Microsoft) responded · March 11,
2015 Thanks for the suggestion! We’re currently in the planning
process for enabling an iterative shelveset experience. We’ll update
this item when we have more details.
But so far, we do not have a very easiest way to rename a shelveset in TFS. And we do not have a "update shelveset" API in place:
Shelvesets
Do not have option to rename the name by the Shelve Command.
You could check this thread for some more details.
So, I agree with your idea is the easiest and most straightforward, and it is also the method I have used.

Migrating from TFS to VSTS with TFVC

My usecase:
Currently have TFS 2012 (on Prem)
Want to move to VSTS
Want to migrate only the SourceCode with history, don't need any workitems, etc.
Questions:
1. What are the tools I can use?
2. Is it mandatory to upgrade to TFS 2018 first before migrating to VSTS
If you want to migrate the source code only then you have 3 options.
The MS recommended route is to upgrade to TFS 2018 and then use the Database import feature of VSTS. This is the only way to keep using TFVC and keep the full history in tact.
You could use OpsHub however this comes with limitations as it will "replay" the history so the changeset history will reflect the time of the migration rather than the time of the original check-in. Also if you have multiple team projects then you might need to pay for the tool.
If you only want the code and you are happy considering changing version control systems from TFVC to Git then this might be the simplest option. You could use Git-TFS essentially you would clone the TFS (TFVC) repository to a local Git repository. At this point you would have a full "copy" of version control including history and branches, but in Git instead of TFVC. You could then push this up to VSTS, the only "downside" is that you would now be using Git rather than TFVC, Git is good, but different so you will want to think about that.

Custom TFS 2013 activity to merge one branch to another

We are using TFS 2013 and need to write a custom TFS activity that auto-merges from one branch to another.
So for example merge code from...
$/Parent
to...
$/Other/Parent
If one were to assume a happy path where there are no merge conflicts, can someone show a simple code segment that merges from $/Parent to $/Other/Parent please?
I have found an example for earlier versions of TFS, but the API has changed for 2013, and I am not seeing how to translate it. Here is a link for how to do it in XAML for versions prior to 2010.
Automate Merge With TFS Build
I am seeking a C# code example that does the same thing for 2013.
Thanks.
Do not create custom activities. They are difficult to debug and are only supported for legacy in 2015. Create a PowerShell script that completed the task (you can still call c# in there). The 2013 template has slots for running PowerShell and your scripts will work in the new build system in 2015.

Merging all changesets associated with a WorkItem in Team Foundation Server

We're trailing the use of the built in bug tracking, and have written some integration into our helpdesk software that allows for escalation via workitems.
One thing I haven't found out how to do, is to merge all changes associated with a work item (say to go from dev branch to main) - I appreciate you can double click on a changeset in the merge dialog to view if it is associated with a workitem, and also that I can select individual changesets, and groups of adjacent changesets; but there doesn't appear to be any way to merge changes by workitem?
It is correct that you can't merge based on work items. It is probably not a good idea to do that anyway. It would be very difficult to make sure you get all the necessary changes needed for the main branch to build correctly. I would look into how you do your branching and a good starting point would be: Microsoft Team Foundation Server Branching Guidance
In TFS 2005 and 2008 the check in history will not be transferred between branches. You will get this in TFS 2010.
Merge changesets by workitem - https://tfsprod.codeplex.com/
Check out the ExtendedMerge feature.
Enjoy! :)

Resources