Visual Studio Team Foundation Server 2010 branch visualizations - visual-studio-2010

While maintaining code branches for a particular project I am noticing that the source control panel does not align with the branching hierarchy for the project, confirmed by visualizing the hierarchy by clicking on the branch <Context Click> | Branching and Merging | View Hierarchy.
The source explorer picture at MSDN - Working with TFS 2010 Code Branches shows plus signs in the source explorer as expected.
I also tried creating a new branch, changing the "Target Branch Name" to $/Net Pr/Ye/Pe/New-Branch and received error:
TF203028: You cannot create a branch at .. .. because a branch already exists.
---Add---
How do I get my source explorer to reflect the branching hierarchy, as indicated in the MSDN reference?
---Add---

Related

Communication with TFS from client project

I have client project (angular) that hosted on tfs.
In Solution explorer in Visual Studio window I don't see any indication showing connection to tfs.
Is there a way to see an indication of the tfs in such a project?
For different source control, there is different indication.
If you are using TFVC. In the front of your project, there should be a lock icon which indicate the project file already in TFS Server.
If you are using Git. You could find this info in the status bar.
2 shows the number of unpublished commits in your local branch. Selecting this opens the Synchronization view in Team Explorer.
3 shows the number of uncommitted file changes. Selecting this opens the Changes view in Team Explorer.
FabrikamFiberWeb shows the current Git repo. Selecting this opens the Connect view in Team Explorer.
master shows your current Git branch. Selecting this displays a branch picker to quickly switch between Git branches or create new
branches.
Note:
If you don't see any icons such as 2 or 3, ensure that you have a project open that is part of a Git repo. If your project is brand new or not yet added to a repo, you can add it to one by selecting on the status bar, or by right-clicking your solution in Solution Explorer and choosing Add Solution to Source Control.
More details about how to use Visual Studio and Azure DevOps Git Repo please refer this official tutorial--Share your code with Visual Studio 2017 and Azure Repos Git.
The solution is to add the project folder to a new project template: Blank Azure Node.js Web Application.

Moving all items up one level in Visual Studio Team Services (TFS Source control)

When initially adding a project to Visual Studio Team Services (TFS source control) I accidentally did the following:
My Local code structure is as follows:
C:\Projects\MyProject
src
test
projectDocumentation
projectReadme.txt
MyProject.sln
This is the structure I wanted on VSTS TFS when doing my initial commit. So after the commit I expected it to look like the following on the VSTS TFS end, but it did not because of a mistake I made:
BuildProcessTemplates
src
test
projectDocumentation
projectReadme.txt
MyProject.sln
The mistake I made was mapping my local directory to $/MyProject/MyProject rather than just $/MyProject as a result it looks like this on VSTS TFS which is incorrect:
BuildProcessTemplates
MyProject
then within a MyProject folder is all of my outer level project files.
What would be the recommend way to fix this without clearing everything out of source control and starting over? The first thing I did was change the workspace mapping on my local machine to be: $/MyProject <--> C:\Projects\MyProject rather than $/MyProject/MyProject <--> C:\Projects\MyProject, but this is not changing anything on the VSTS TFS side of things.
You can’t do it on VSTS server side directly, the simple way is that:
Open Team explorer of Visual Studio
Click Source Control Explorer to open source control explorer window
Choose corresponding workspace
Create new folder (MyProject)
Right click folder/file > Move > Select target path
Check in pending changes

How to convert a deleted regular directory into a branch in TFS?

I'm in the middle of migrating a repository from TFS to Git, and I'm using git-tfs.
I've already converted my Trunk branch using 'git tfs clone ...' successfully. When trying to 'git tfs branch --init' a related branch it fails with the error message: 'error: TFS branches $/foo/myrelatedbranch not found!'
This seem to be caused by the $/foo/myrelatedbranch no being a proper tfs branch. The 'branch' documentation (https://github.com/git-tfs/git-tfs/blob/master/doc/commands/branch.md) seem to be pretty clear on the related branch having to be a PROPER branch (https://github.com/git-tfs/git-tfs/blob/master/doc/commands/branch.md#merge-changesets-and-branches).
The branch $/foo/myrelatedbranch has been deleted a while back, so I'm not able to see the option 'Branching and Merging -> Convert to Branch' in the Source Control Explorer.
Is there any way of making this deleted directory a proper branch in TFS?
Using Visual Studio 2015 and TFS 2015
You can configure the Source Control Explorer to show deleted items:
From the menu bar choose Tools, Options.
On the Options dialog box, navigate to Source Control, Visual Studio Team Foundation Server.
Select Show deleted items in the Source Control Explorer, and then choose OK.
If you now open the Source Control Explorer, you can view the deleted folder and convert the folder to a branch.
You can also rollback the changeset that deleted the folder. The rollback will create a new changeset where the changes are negated (so in this case, where the folder is added).
If the problem still exists, you could just take a snapshot of the latest version and migrate that to Git.

TFS 2010: Project file gets deleted on Get Latest Version

We have a standard installation of TFS 2010 with a handful of developers. We do have a number of projects with a number of branches but nothing to crazy. Frequently we will go to get the latest version of a solution and TFS will delete the project file (csproj) of one of the projects, a MVC 3 web project. Looking at the Source Control logs we see the following error:
One or more source control bindings for this solution are not valid and are listed below.
Source control bindings can be modified by selecting File, Source Control, Change Source Control from the main menu.
If we go into the pending changes view and undo the deleting of the project file everything works fine. Does anyone know what the error message means and know what it is that we are doing that is causing it?
Environment:
TFS 2010
VS 2012
SQL Server 2008

TFS SCC: How can I get new files listed in the Pending Changes Panel in Visual Studio

We are experimenting to use Microsoft Team Foundation Server Source Code Control as a replacement for SVN.
Therefore, it would be great if the friction for this transition would be minimal.
For example, in SVN, whenever I create new files in the folder, and then use "Tortoise SVN Check for Modifications", I get a master list of Added Files, Deleted Files, and Edited Files.
I know that in TFS SCC in Visual Studio, the equivalent is the Pending Changes Panel. However, this panel only lists Edited Files. How can I get new files listed in that panel, too, just like SVN does?
The workflow really depends on whether you are using Local Workspaces or the traditional Server Workspaces. As you are coming from SVN, Local Workspaces would probably be a good fit.
Local Workspaces (New to TFS 2012)
Local Workspaces are TFS's attempt at DVCS and actually gives you a much more SVN-Like experience. The pending changes window with local workspaces is divided up into the following areas:
Included Changes - This is effectively files that are already in Source Control that have been changed.
Excluded Changes - These are all files within the workspace that are not in source control. This is like your Added files in SVN.
Server Workspaces
Server Workspaces are the traditional TFS workspace approach. An item is not in Source Control until it is explicitly added.
There is a much more detailed article on the differences here: http://msdn.microsoft.com/en-gb/library/bb892960.aspx
Drag and drop your new files into the right folders in the Source Control Explorer in Visual studio and then there will be asked if there are also files that need to be excluded from the source control. If that is done they are in the Pending changes window. The implementation like SVN is starting from Visual studio 2012 but then still it can give issues and not be in that panel.
I see this is an old question but I believe the answer is in Visual Studio's "Pending Changes Panel" itself. Notice the "Excluded Changes (nnn)" section. Just below that heading you should find "Detected: nnn add(s)". You can see your 'new files' listed there.
For what it's worth, I find the "Pending Changes" an unwieldy feature in that it seems it's never context aware. I find that I often have to "weed through" many, many files that are simply not relevant to the solution/project(s) at hand.

Resources