Add files from Team Foundation Server 2010 dev branch to main - visual-studio-2010

we are using TFS 2010 for version control and the development IDE is VS 2010. We only have two branches at the moment, Main and development branch.
Recently, we added new files to the development branch. My question is, how can I add those files to the Main branch? I can't do a merge because those files do not exist in the Main branch for TFS to merge to.

You need to do a merge from Dev to Main.
When you do the merge the new files in Dev that don't exist in Main will be added as a [Merge, Add] action. Then you check into Main.

Related

TFVC: Annotate shows changes in development branches

I have a problem with annotate (Source control) in Visual Studio 2019 connected to TFS 2017. I get information from development branches when I annotate files in the MAIN branch.
Example: The file file.cs is in the MAIN branch. I branch it to a release branch and check in the file as changeset 1,2,3,4 and 5. I then merge the file to the MAIN branch in changeset 6.
When I annotate the file in the MAIN branch I see the changes done in changesets 1-5 from the development branch. I do not what that.... I only want to see the changes done on the MAIN branch, i.e. changeset 6.
Is there anyway to achieve that?

TFS: Merging .csproj files between two branches that have project references between two branches

I'm having a problem with merging dev branch into main branch when .csproj project files in those branches each have other project references in their said branch. For example, imagine the TFS source control structure below:
Web Project 1 (TFS Team Project)
Dev Branch
MyWebsite.csproj
Main Branch
MyWebsite.csproj
Web Project 2 (TFS Team Project)
Dev Branch
MyWebsite2.csproj
Main Branch
MyWebsite2.csproj
Database Project (TFS Team Project)
Dev Branch
MyDatabase.csproj
Main Branch
MyDatabase.csproj
Other Common Library (TFS Team Project)
Dev Branch
MyClassLibrary.csproj
Main Branch
MyClassLibrary.csproj
In reality, the structure is a bit more complex than the above as there are more projects that have the same branch structure, but the problem to be solved is the same.
The Website Project Dev Branches reference the Database and Common project Dev Branches, and the Website Project Main Branches referenc the Database and Common Project Main Branches. For example, the reference in the MyWebsite.csproj file might be:
<ProjectReference Include="..\..\Database Project\Dev Branch\MyDatabase.csproj">
<Project>{312ced42-f890-4d64-b27d-9ae53a42304c}</Project>
<Name>MyDatabase</Name>
</ProjectReference>
So, you're making changes in the dev branches, and the .csproj files in the dev branch are properly referencing the other .csproj files in the dev branch; but when you go to merge the dev branch into the main branch, the .csproj files are trying to update the references from the trunk branch to the dev branch.
What is the best practice to resolve this issue so that when you merge from dev to trunk, the trunk projects still properly reference the other trunk projects and don't get updated to dev branch references?
edit looking for a non-nuget suggestion and am not able to combine them under one branch because the actual structure is far more complicated than outlined above. There are 3 separate web applications in 3 separate TFS team projects that reference several of these common libraries, which are also each in their own TFS projects. And then each of these team projects have dev and main branches.
If these things are versioned separately, stop relying on project references. Turn them into NuGet packages, publish them to a NuGet feed, and rely on NuGet references to restore the correct version.
If these things are not versioned separately, put all of them under the same branch and rely on relative paths for your project references that do not include the branch folder name.

How do I change the branch I am currently developing for in Team Foundation Server and Visual Studio 2013?

I am using Visual Studio 2013 on a project with Team Foundation Server. I created a new branch, but when I click "Get Latest Version", I get the latest version from the old branch, not the new branch, and when I commit changes, the changes are made to the old branch. How can I change the current branch in Visual Studio 2013 so I can develop on the new branch?
It sounds like you're using TFVC. Branches in TFVC are represented in different folders in the source control explorer and in your file system.
If you want to make changes on a branch, open the solution file from the appropriate branch. If it's not in your file system, map a workspace to the appropriate branch.

Visual Studio Merge Changes In Merge Tool Missing

I taken branched from master branch. While I work on branch, other developers worked on master branch. While merge operation branch to master branch, i saw multiple conflicts. I wanted manual merge but missing "Merge Changes In Merge Tool". There are just Keep Target Branch Version and Take Source Branch Version buttons. What can i do for issue?
PS : This issue, there are just .cs files.
If it's only for .cs files merging would probably been disabled.
In Visual Studio go to Team Explorer > Settings
Under section Team Project Collection > Source Control you can manage file extensions an the enabling of file merging.

How to Branch and keep the branch history with TFS 2013

I need to create a branch in TFS and copy the code and the history from the parent branch.
I am using TFS 2013 with Visual Studio 2013, is there a way to easily do this ?
Branching is a technique for creating a parallel set of versions of your files. So the branch will have the same codebase as parent branch.
Regarding the history, the file will keep the history under the branch change, check the screenshot below:

Resources