Version Control & Branches
Master version control and branching to safely experiment, track changes, and confidently update your catalog without disrupting production. Test, merge, and manage with ease!
Transcript
In this tutorial we're going to explore how to use version control and branching in your catalog. These tools give you the flexibility to navigate your catalog's history, experiment with changes safely and promote updates into production with confidence. With version control you can move forwards and backwards through your catalog's history. This means you'll never lose changes permanently. You can always restore previous versions if needed. Branching takes us a step further letting you try out changes without affecting your live catalog. To access your catalogue's history open your catalogue and click on edit catalogue. In the yaml editor look at the left hand side under source. Here you'll see the branch name, a version code and the time of the last commit. Click the commit history icon to view every change ever made to this catalogue. You can browse all the versions by clicking on the code icon next to a commit. This lets you see exactly how the catalogue looked at that point in time. If you'd like to restore a past version click validate and revert catalogue. This will overwrite your current version with the historic version. If you only want to look around you can simply click back to latest to return to the latest version of your catalogue. Branches are perfect for testing new ideas without disrupting your production catalogue. To create a branch, open the drop down next to your branch name and select create new branch. Give it a clear descriptive name so others instantly understand the branch's purpose. Your new branch starts as a copy of your live catalogue. From here you can add new items, make edits or delete existing items. Any commits you make will only affect your branch and not production. Let's add a new view on this branch. I've added a new view to my branch and I can now commit my changes. You'll notice there's no validate step this time this is because I'm not on a live production branch. You can test your changes by switching between branches in connecting canvases. When entering a canvas you'll notice that I have a branch picker under my datasets. On the main branch you will see the production catalogue. On my dev branch you'll see experimental changes. This is the best way to compare how new datasets or views behave before making them live. Once you're happy with your branch you can merge it into the main branch to make changes live. If you don't need the changes anymore you can just delete the branch. Be careful when deleting. Once a branch is gone its history is not saved so only delete branches you're sure you don't need. Another good habit is to keep your branch updated with the latest from the main branch before you start editing. This avoids conflicts later when you come to merge. Let's have a look at how you can update a branch. I have a second branch. This is a copy of my catalog. If I now move into my main branch and make a change, when I move out to my development branch you'll notice I now have the option to update the branch. This will copy the change from my main branch out to my development branch. This is best practice when you're working with branches to maintain the latest version on the branch before you go and apply any changes. Now you can see I have my new views. If you go into version history you'll notice that both of these appear on the same line. This is because this is the version that they both live in. What happens if I roll my main branch back to that previous version? So now I'm once again just looking at pure Spotify data. When I look at the version history you can see that my main branch is on this latest version but my secondary branch is on this previous version. It's then up to me whether I want to update my secondary branch or in this case I'm actually going to retire the secondary branch and delete it because I don't need it anymore. By using version history and branching you can undo mistakes, test safely and publish with confidence. Remember to name your branches clearly, test thoroughly before merging and keep your workspace tidy by retiring old branches. With these practices, managing your catalog becomes flexible, reliable, and stress free.