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?
Related
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.
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.
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:
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.
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.