1

We're using TFS 2015 with its native source control (non GIT) to host our VS 2013 solutions.

Lately, i have created a branch. I needed to manually fix the Scc-sections in the vcxproj files, as these contained the branch name explicitly in the SccProjectName-setting. Same when i wanted to merge the branch back to the main trunk. I needed to take care that the modified sections did not get merged back to the trunk. This is very annoying. How to fix this?

I have searched and found lots of pages suggesting to use

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

with the Scc-binding metadata located elsewhere (MSSCCPRJ.scc?). This seems reasonable to me.

But i don't understand what we have to do explicitly and what it could break. I am no expert in TFS setup and configuration.

Scrontch
  • 3,275
  • 5
  • 30
  • 45

1 Answers1

2

I also recommend to use below Scc, actually it's the default Scc setting when you add a project to source control in TFS.

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

In your case, you can try to remove the branch name in the SccProjectName-setting for both Main and another branches if that is an option without any policy limits.

Another way is trying to exclude the .vcxproj files if there are no any other changes need to be merged back to trunk.

  • What we do in this case is we perform the merge, then undo the changes for those files we want to exclude. Once that is done we checkin the changes. When you perform a merge, it only merges in your workspace. It doesnt go to the server till you checkin.
  • You can use tf.exe from the command line to force the .vcxproj files not to be included in the merge operation: tf.exe merge /discard <path to .vcxproj file > <destination branch>

    See Merge Command for details. Also reference this thread : Exclude a config file from the merge process

For MSSCCPRJ.SCC related info, please refer to this article, hope that helps.

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • Hey, thanks. I would like to have some deeper understanding than just trying out things though. Ignoring/reverting the changes do vcxproj files is what i have done so far. But this isn't satisfactory in the case that there are real changes to the vcxproj files that need to be merged. – Scrontch Sep 08 '17 at 08:32
  • @Scrontch So what about the default Scc mentioned above? If there isn't the SccProjectName-setting, the problem should be resolved. – Andy Li-MSFT Sep 08 '17 at 09:17