Merge into Main from Databricks to Azure Devops without Conflicts

Welcome back! In today’s post, I’m walking you through how to push your code from Databricks to Azure DevOps — and more importantly, how to do it without running into those pesky merge conflicts.

This guide is great if you’re just getting started with version control in Databricks or looking to improve your branching and merge strategies.

Prequisitive: must have connected your databricks to your Azure Devops account, here the guide: https://journiql.com/how-to-connect-azure-devops-to-databricks/


Step 1: Clone Your Azure DevOps Repo

First things first, head over to Azure DevOps and clone your repo. Don’t worry if it’s empty — even a repo with just a README will do for now.

In Databricks, go to your Workspace home and create a new folder. Then just paste the repo URL you copied and clone it inside that folder.


Step 2: Create a Feature Branch

Once your repo is cloned, you don’t want to push directly to main — that’s not good practice.

Instead, create a feature branch. You can name it something like feature/test-for-youtube (or better yet, include a ticket or task ID). A simple description helps too, even if it’s just for demo purposes.

This step is crucial to keep your main branch clean and stable.


Step 3: Pull the Latest Changes from Main

Before you start making changes, switch to the main branch and do a pull. This ensures you’ve got the latest updates. Even if you’re pretty sure nothing’s changed — it’s still good practice.

Then, switch back to your feature branch.


Step 4: Merge main into Your Feature Branch

This is the step that helps you avoid merge conflicts later on.

Pull from main, and then immediately merge those changes into your feature branch. The sooner you do this, the easier your final merge will be — especially in teams where changes happen fast.


Step 5: Make and Commit Your Changes

Now you’re ready to update your code. For demo purposes, I just edited the README file — added a “Hey folks” line in markdown.

Databricks is great at showing you the diffs (what changed), just like Azure DevOps. When committing, make sure your message is clear and meaningful. Something like:

Updated README to include a friendly greeting

Then, commit and push your changes.


Step 6: Create a Pull Request to Merge into Main

Now back in Azure DevOps, you’ll see your new branch and changes. Time to create a Pull Request (PR).

In the PR description, it’s good to include:

  • Why you’re making this change
  • What feature or task it’s related to
  • What you are doing

Once ready, hit Create and Complete Merge. – You may need reviewers at this step depending on how your branch policy is set up.


Step 7: Verify the Merge and Clean Up

Check your main branch — your changes should now be visible there. If you did everything right, Databricks should reflect this automatically.

Sometimes I have to refresh or navigate around a bit, but eventually, you’ll see your updates merged in.


Wrapping Up

And that’s it — you’ve just pushed and merged code from Databricks to Azure DevOps with zero conflicts!

To summarize:

  • Use branches — don’t push to main directly
  • Pull from main early and often
  • Merge main into your feature branch regularly
  • Keep your commit messages and PRs clean
  • Practice good habits, even in demos!

This is a pretty trunk-based strategy, but it can be adjusted based on your team’s workflow. Once you’ve got this flow nailed, it becomes second nature.

Thanks for reading (and watching). Be sure to check out the full video and other tutorials on the channel. And as always — happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *