Skip to main content

Git

How to connect to external GIT

To connect to an external git, the process is as easy as configuring your:

  1. GIT Repo URL: e.g. https://github.com/user/git_demo.git
  2. Path: path to project inside the repo. e.g. /first_project
  3. Email and username
  4. Access token

Please refer below video for step-by-step example:

How to commit changes

When you create your first project, dev branch is automatically created for you. This is to ensure that no edits/commits are made directly on the main branch and a proper CICD flow is followed during development.

Creation of first project and commit changes to dev branch:

How to create/checkout branch

Currently we are on dev branch which has our first_pipeline. Now let's see how to go back to our main branch and also create a new second_branch from the main branch.

How to merge changes

Let's merge our first_pipeline from dev branch into main branch.

How to Pull changes

Pulling changes from a branch is as simple as in any GUI based git interface. Let's pull our main branch into the empty second_branch which we created earlier. Please refer the below video for step-by-step example:

note

Currently pull only from main branch to any specific branch is supported.

How to release a branch

Once the changes are merged, we can release a branch straight from the UI itself.

GIT after release

note

Databricks scheduler changes would only come into effect once the project is released.

How to resolve conflicts during merging

Now let's create a project in third_branch with same name as first_pipeline and put a different path in dataset. Post this once we pull the changes from main into this branch, it would have conflicts as first_pipeline exists both in main and current branch.

One way is to use the git interface directly to resolve conflicts between branches.

Or we can use the simple merge UI on prophecy to resolve the conflicts

Let's see in the video below on how to resolve conflicts using simple merge on prophecy:

How to use fork per usage GIT storage model

During the creation of project there is an option to choose fork per usage as GIT Storage model. When you fork a repository, you create a copy of the original repository (upstream repository) but the repository remains on your GitHub account.

When using the fork per usage GIT storage model while creating a new project, apart from the upstream repository details, below extra pop-up would come for details of forked repository.

Fork repo setup

Let's create a fork of our original repository and pull main branch from original repository to our newly created forked repository.

Now to pull main branch from upstream repository or from origin of current repository is as simple as clicking on below Pull Upstream or Pull Origin options

Fork repo extra options

note
  1. Any changes made in forked repository would not effect the upstream repository and would only reflect in the forked repository.
  2. Please follow the normal git flow for raising pull requests to the original repository (upstream repository) from the forked repository.