TFS merge changes not detected - tfs

I have 2 branches (A and B) and the situation looks as follows:
On branch B, for one file I clicked Get specific version and picked the first version of this file. I then switched to branch A to merge version from branch A to B but it tells me that there are no changes to be merged. When I click compare on both files there are many changes

After doing the "Get Specific version" you need to check out every file in the changeset manually (right-click, check-out). Be sure that you have the "Get latest on checkout" turned off.
After that perform a get latest, which will prompt you to merge. This is going to be a more tricky merge, since Visual Studio will assume that the newer version is what you want. When you're satisfied (you can keep local version), check in the code. Then merge branches.
You can also try "Get This Version" on the changeset. This is MUCH quicker than "Get Specific version" because you don't have to download the whole repo again.
Follow below steps to do that:
1) Go to Tools-->Options, select Source Control-->Visual Studio Team Foundation Server. Un-check 2 options shown below.
2) For the file you'd like to edit, select the file, right click and View History. In the history screen, select the version you would like to edit. Right click and select Get This Version.
3) In Solution Explorer, double click the file and it should open the version you selected in the History view.
4) Make your edits and Check-In. You will get a Resolve Conflicts screen. From there either Merge Changes In Merge Tool or select Keep Local Version to check in the file as is.
5) Merge branches.

Related

How to change TFS Project version

How to change TFS project version and how to use old versions.
I explain my question with an example.
I have a number of projects in solution name is TestSolution.(Suppose solution version is 1.0)
I create publishing file of the solution suppose 10-Dec-2013 and publish to Client (we are changing version 1.0 to 1.1).
After that we are modifying the project, On 15-Dec-2013 the client asking for a small change that change will fit in Version 1.0 then we need to create a new publishing file on Version 1.0. Is it possible on TFS 2010? And merge the change form on Version 1.1?
Yes, you can branch a directory in source by date or changeset.
To branch by date or changeset:
1.In Source Control Explorer, right-click the folder or file that you want to branch, point to Branching and Merging, and then click Branch.
The Branch dialog box appears.
2.In the Target box, modify the location and name for the new branch.
You can also click Browse to specify a target.
3.In the Branch from version section, click one of the following options in the By list:
If you click Changeset, you can specify the number of the changeset in the Changeset box. As an alternative, you can click the ellipses (…) to open the Find Changesets dialog box.
-If you click Date, you can specify a date in the Date box.
I would suggest you look at using labels on your source when you release. It gives you the ability to have an exact marker of your source to branch from in the future if needed.

Revert TFS branch to original

I'm using TFS. On my branch I checked in a bunch of changes, that I now want to undo.
I can click on the branch in TFS Source Control, and view history, and get the original branch, but when I check it out to edit... it reverts back to the branch that I boned.
I tried both "View History" then right clicking on orignal "create" branch and then "get this version"
And I also tried right clicking on the branch and "Get Specific Version".
I also tried deleting the local files for this branch.
How do I just get the original version?
(Note: Deleting + Recreating the branch is a huge process so I'd like to stay away from that)
Depending on the version of TFS you're using and on whether you have the TFS power tools installed, you can either find it in the History Panel (under the Rollback item). You can always do it from the commandline using
tf.exe rollback

Team Foundation Server - Viewing files in the last commit for a user

I want to know how to view a list of all files that was committed by a user in their last commit. Not all files committed by them just the ones which were committed in the last batch. For example, suppose I just committed 10 files in TFS and now I want to view the list of just those 10 files.
How do I do that?
Thanks,
-R
In visual studio 2010 you can also go to file, source control, changesets and search for changesets from this windows. You have the option of applying filter on changesets by users, or by date or by change set ids. Get the results and you can double click to see the files that are part of the changesets displayed in a new window.
Or you install Team Foundation Sidekicks and go over the shelveset sidekick menu and get this screen
Ok got it.
Open any single file that you remember being part of the changeset in Visual Studio. Right click the file, go to source control and click on view history. Select the version you committed and right click then select view changeset details.
-R

TFS: Updating branch with changes from main

So, we have our main dev line, I create a branch, and developer b creates a branch. We both do some work. developer b finishes his work, merges back into the main dev line. I know his changes will affect me, and rather than deal with the conflicts later, I would like to update my branch, with the changes that are now in the main dev line, so I can deal with them in my branch, prior to merging back into main.
How do I do that?
From Visual Studio, open Source Control Explorer:
View | Team Explorer
Select your Team Project from Team Explorer, expand it, and double click Source Control
In the left-hand pane of Source Control Explorer, select your Team Project.
In the right-hand pane, find your mainline branch, right-click and select Merge...
In the Target branch drop-down, select your dev branch.
If you want a subset of all the changes in the mainline:
Choose the Selected changesets radio button, click Next.
Select the changesets that represent the merge from your other dev's branch into main, click Next.
Otherwise, keep All changes up to a specific version selected, click Next
The next step has you pick a Version type. The default, Latest Version is obviously straightforward and self-explanatory: you would be brining all changes since your branch was created from the mainline down into your branch. The other choices are straightforward, but a tutorial explanation of each option available here would take a fair amount of space.
Walk through the remaining steps of the wizard.
Click Finish.
If there are any errors or merge conflicts, you will be prompted to resolve them, similar to what you would see if checking your changes into source control when other changes had been made since last checkout.
After the merge is done, all the changes are in your local copy of the branch, but they are not yet committed to source control. Once you've completed all your builds and testing on your branch, you can check in the merge. From Visual Studio:
View | Other WIndows | Pending Changes
Make sure all the files related to this merge are checked, add comments describing the merge, and click Check In.
I recommend keeping merges (and any necessary merge conflict resolution, build breaks, test breaks) as their own changeset. That is, do not mix other feature work with merges. Granular changesets make it much easier to review source control history, and to identify a single change of interest. Keeping merge work in its own changeset helps work toward that goal.
There is command-line for merging as well, run tf merge /? from a Visual Studio Command Prompt.

TFS Branch/Merge meets History View

We have a setup with a development "trunk" in our recently-migrated-to-from-VSS TFS system and developers have been doing work in branches off the trunk, which are merged back in.
We've been diligently commenting our changesets at check in time, something we never did in the VSS days. However when I right-click on a trunk file in the Source Control Explorer and choose History, I only see monolithic changesets labeled "merge from dev branch" (or whatever the developer scribbled in there when they merged.) A history entry doesn't even seem to contain info on which branch was merged in at that time, let alone any info about the changesets that make it up, or the comments that go with them.
How have other TFS users dealt with this issue?
Is there another way to view the history that I'm missing here?
Looking at the history of a change prior to the merge has been a bit of a pain point with TFS. So much so that Microsoft have done a lot of work to address this in the next version of TFS (TFS 2010). In TFS 2010 (when it comes out), when you get to a merge in the history view it is actually a little twistie that you can expand and go see the history for the thing that was merged which is much nicer.
In the meantime, when I see I big monolithic merge (or branch) comment I tend to let out a audible sigh and then go find the file in the branch it was merged from in Source Control Explorer and do a view history there.
This might be what you are looking for: http://www.codeplex.com/TFSBranchHistory
Haven't used it personally, so I can't vouch for it.
Visit "TFS Branched History" plugin page at Microsoft Gallery:
http://visualstudiogallery.msdn.microsoft.com/7d4f37b6-f9a4-44c6-b0a0-994956538a44
Plugin does insert "Branched History" button into the context menu of Source Control Explorer (TFS)
The button icon is with clock like standard "History" but with blue arrow:
If you click "Branched History", new window will be opened and Path property will be set to the current Source Control Explorer path:
Click "Run query" to get results at the "History" tab:
From context menu you can query standard Changeset Details and Compare File (Folder) dialogs.

Resources