Documentation

gitHub

Collaborate on data models with Git

This how-to guide shows how a team of data modelers works on the same models with Hackolade Studio Workgroup Edition and a shared Git repository, without typing Git commands. It follows two data modelers, Ana and Ben, who work on a Webshop model for PostgreSQL, as in the video below.

Team collaboration with Git

If Git is new to you, this video and article below are a good introduction, then the Concepts page explains the terms in more details.

Checkout and lock force unmanaged copies

With legacy data modeling tools, when one person checks out a data model in a model mart or team server and locks it for editing, other modelers become creative and end up creating copies of the model. Soon, nobody knows which version is current, who changed what, or why.

Model files named webshop_v3_final and webshop_v3_REALLY_final on a shared drive, and a model checked out and locked by Ben

Clone the repository

To let several people edit the same models at the same time, Hackolade Studio Workgroup Edition keeps your team's models in a shared Git repository, on GitHub, GitLab, Bitbucket or Azure DevOps. Each data modeler clones the repository, with its complete history, to their own machine. Ana and Ben then work in parallel, even offline, and nobody has to wait for someone else to check in a model and release a lock.

For occasional work with a model, Hackolade Studio can also open models directly from the repository, without a clone. See Working directly with a remote repo.

Ana and Ben each clone the team repository to their laptop with its full history, while an occasional reader opens a model directly

In Hackolade Studio, you can enter a repository's address, pick an empty folder on your local drive, and click the Clone button. See Clone a remote repository. Your organization may have multiple repositories for your data models, and there is no limit to the number of repos that can be tracked with Hackolade Studio.

Save and commit

Saving and committing are two different steps. When you save, Hackolade Studio writes the model file to your machine. When you commit, Git creates an immutable version of the model, which marks a checkpoint in its history, with a short message that describes the changes. You can reopen any version later, so you don't need to put version numbers in file names.

Saving writes the model file to Ana's laptop, and each commit adds a version with a message to the model history

When you make changes to a data model and save it, a badge on the Repository icon in the left bar reminds you to commit. In Commit local changes, the Review changes... button opens a screen that shows what you modified in the model. You must enter commit message, ideally descriptive enough that you and others will understand the purpose, and click the Commit button. See Commit local changes.

The Commit local changes page with the message Add phone number to Customer, and the Review changes, Commit and Commit & Push buttons

Push and pull

A commit stays on your machine until you share it. With the Push action, Hackolade Studio sends your commits to the team repository. With the Pull action, Hackolade Studio brings your teammates' commits into your local copy. Make it a habit to pull before you start editing, and to push often so that the team repository stays up to date.

Ana pushes her commits to the team repository, and Ben pulls them into his local copy

After each commit, and before the commit is pushed, Hackolade Studio checks for your teammates' commits and walks you through pulling them, then pushes yours. See Pull remote commits and Push local commits.

Edit the same model at the same time

Multiple different users can edit the same model at the same time. Hackolade Studio stores each property separately, so changes to different properties are merged automatically, as well as moves in the diagram. A conflict occurs only when two people change the same property of the same object at the same time, which is rare.

Changes to different properties of the Order table are merged automatically, while two new names for the same column are a conflict to solve

In the rare case of a conflict, the user wanting to push last must arbitrate. The situation is automatically detected by the application , and the Solve Conflicts screen shows both conflicting versions, plus the merged result side-by-side. The user must pick the version to keep, then commit and push. See Solve conflicts.

The Solve Conflicts screen with Ana's version, the merged model and Ben's version of the Order table side by side

Use a branch for bigger work

A branch is a separate line of work that splits off from the main branch, the one everyone pulls from. Commits on a separate branch leave the main branch untouched until the branch is merged. You may embark on a long-running feature branch, while minor but urgent fixes must patch the main branch through short branches. On a regular basis, you may bring these fixes into your branch, so that it does not drift away from the main branch. When your work is ready, you can merge your feature branch into the main branch, typically after a peer review.

Ben's short branches for minor fixes and Ana's long-running loyalty-program branch, which brings in each new version of the main branch and is merged after peer review

See Checkout a branch.

Submit a branch for review

Before a branch is merged into the main branch, it is preferable that a teammate reviews it. GitHub calls this a pull request, and GitLab calls it a merge request. Changes that you make with AI-assisted data modeling go through the same review. Your administrator can protect the main branch, so that nothing is merged without approval. See Branch protection.

The loyalty-program change request is updated with Ben's fixes, reviewed, reworked, approved, and merged into the protected main branch

You should submit your branch for review, with the main branch as the target, a title, a meaningful description, and select the right colleague or designated maintainer as the reviewer. See Submit for review.

The Submit for review page with the loyalty-program branch to be merged into origin/main, a title, a description and Ben as reviewer

As other users' changes may have reached the main branch in the meantime, you may need to click the Update button in the change request to bring them into your branch. The reviewer clicks the Review changes... button and sees the the changes to the model. They may approve the request immediately, reject it, or ask for additional changes before approving it.

Ben reviews Ana's change request

See Review change requests.

Explore the history

Every commit stays in the immutable Git history, with who changed what, when, and why. Hackolade Studio does not let you rewrite the Git history, but you can return to an older version if needed, and make it the current one.

The history of the main branch and of Ana's branch, with filters, read-only opening of an earlier version, and comparison of two versions

You can filter the history by model, author or branch. You can open an earlier version in read-only mode, so that you cannot overwrite current work by mistake. You can also compare any two points in time in a comparison screen that shows the differences in the model. See Explore history.

The History page with the commits of Ana and Ben, and the Model, Branch or Tag and Author filters

The daily routine

Clone the repository once. Then pull, do your data modeling work, save, commit and push. For stronger governance, use a branch for bigger work, and submit it for review. Your team can do all of this in parallel from Hackolade Studio, without typing a single Git command.

The routine is to clone once, then pull, model, save, commit and push, and for bigger work to branch, commit and push, submit for review, approve and merge

To learn more about each step, see Working with a locally-cloned repo. For rules that your team can adopt, see Best practices for collaboration and change management.