Finding Changed TDS Content Items in Source Control

Have you ever run into a situation where you needed to find all of the changed content items committed to git since the last production deployment? It's easier than you might think. It doesn't even involve nagging all of the other developers on Slack.

The Git command line gives you great power in finding what's changed. In this case we need to:

  1. Find out when the last release branch/tag was cut
  2. Query the log to find any content item that has changed since that date

Let's start by finding the last commit of the previous release. We tag our releases so we can just type git describe --tags. That will display something like CDPROD-20190702-2200-2.0.204-544-g1b6ee7a90. From there we can run the command git log -1 --format=%ai CDPROD-20190702-2200-2.0.204-544-g1b6ee7a90 which will give us the date: 2019-07-02 15:05:17 -0400.

Now that we have the date we can query git to find any content items that have changed since then. This command makes the assumption that TDS content items have 'Content' in the path.

git log master --since "2019-07-02T15:05:17-04:00" --name-status --oneline -- '*.Content*.item'

This will give output similar to this:

GitLogOutput

Finding Changed TDS Content Items in Source Control
Share this