2

At our current project we have two GIT branches which have quite a lot of changes within the TDS sub-project. Merging the two branches in GIT is easy for individual .item files (and TDS provides a tool for that), but nearly impossible for the .csproj file, since it's too large for a meaningful line-by-line comparison. I see several solutions, none of which are perfect:

  1. Use the "Sync with Sitecore" tool to manually sync between the two versions, by connecting from branch A to a deployment of branch B
  2. Ignore the .csproj file and simply recreate it from the merged .item files
  3. Somehow optimize the .csproj file to be readable for a merge tool (how?)

So what's the proper solution?

2
  • Its not an answer, but I have been testing using unicorn for site content and TDS in a Helix format for templates/layouts/etc.... It reduces the merge conflicts a lot. Unicorn because content is changing A LOT in dev. And Helix so I don't have 10 developers in 1 TDS project. I have 35 TDS projects with a minimal number of developers and conflicts.
    – Chris Auer
    Commented May 11, 2017 at 3:15
  • @dnstommy feel free to add an answer :)
    – user1475
    Commented May 11, 2017 at 13:08

2 Answers 2

2

I have been testing using unicorn for site content and TDS, in a Helix format, for templates/layouts/etc.... It reduces the merge conflicts a lot. Unicorn for content because content is changing A LOT in dev. And Helix so I don't have 10 developers in 1 TDS project. I have 35 TDS projects with a minimal number of developers and conflicts.

Making my life a lot easier.

Do have to remember to sync TDS before unicorn because the templates that unicorn needs are in TDS.

How to do it

Unicorn

You can install unicorn into your solution via Nuget.

Install-Package Unicorn -Version 3.3.2

This will install the dlls and some sample configs. What you want is a unicorn serialization config that only does content. I great example of that is the official habitat solution. For each project in Helix you will have a config that deals with just content. For Habitat that config is Habitat.Website.Serialization.config.

This is an example of that config. What you want is for unicorn to keep track of the site content and media. This will make it so any developer who adds, removes or updates content in the dev solution, will automatically get that updated in source control. This make merging content very easy.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <unicorn>
            <configurations>
                <configuration name="Project.Habitat.Website" description="Habitat content" >
                    <targetDataStore physicalRootPath="$(sourceFolder)\project\habitat\serialization" type="Rainbow.Storage.SerializationFileSystemDataStore, Rainbow" useDataCache="false" singleInstance="true" />
                    <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
                        <include name="Habitat.Website.Content" database="master" path="/sitecore/content/Habitat" />
                        <include name="Habitat.Website.Media" database="master" path="/sitecore/media library/Habitat" />
                    </predicate>
                </configuration>
            </configurations>
        </unicorn>
    </sitecore>
</configuration>

You an find more info on unicorn is here

TDS

For TDS and Helix, lucky for us Hedgehog has taken the Helix solution and TDS'ified it. You can find that branch in Hedgehogs Helix fork.

Specifially, looking at this link, you can see how TDS is used in a feature in Helix. Each feature, foundation and project project gets its own TDS project in a folder called tds. The only thing that the tds project would track is just the templates, layouts, renderings, etc... for this feature. This limits the number of developers who would be updating this single TDS project.

To deploy all the projects, I am using a platform TDS project that uses the package bundling feature of TDS to bring all the TDS projects together into one single .update file that you can send to production.

0
1

I've found an easy solution in the end - simply use an appropriate Merge Tool for XML files. In my case I've used the OSO XML Merge Tool:

enter image description here

The above tool can also be used for regular VS project files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.