Committing content

To commit content in BaseHub, simply navigate to the Commit tab, there you can review a detailed "diff" view of all your edits, input a descriptive commit message, and submit your changes.

Joaquín MontesLast Updated August 09, 2024

While you work on BaseHub you don’t have the usual save/publish flow you would encounter in other CMSs, all your changes are saved almost instantly as a work in progress or draft inside your repository. Once the content you edited is ready to publish, you should go to the Changes

Commit Icon
tab in the left sidebar of your editor.

There you’ll see a diff view with all the changes made since the last commit, or if there’s no commits, all your changes. There you need to add a commit message, that can be anything you want, but ideally should describe those changes. Click on “Commit to main” and then the application will validate those changes and if everything looks good it will create a new commit and expose that to the API, that will enable you or anyone in your team to consume that data from your website.

How this article was committed, comparing the diff, choosing what to commit and fixing the validation errors.

What is a Commit?

The concept of commits comes from the Git workflow. A commit in BaseHub (as well as in Git) is like taking a snapshot of your project's files at one moment in time. This snapshot is saved in your project's history, so you can always go back to it if needed. Essentially, every commit acts as a reliable backup that doesn't change.

One thing which is important to clarify is that BaseHub commits are not the same, nor are synced, with Git/GitHub commits. BaseHub's versioning system, while very much inspired by git, is a separate thing.

That being said, a commit in BaseHub should trigger an update to your site if the revalidation logic is configured correctly. You can follow this article to set it up using Next.js.

Validation

When you activate constraints in your blocks that means they will be checked later on commit to validate every new value in the project looks good. If the validation fails, you’ll see a list of blocks that don’t comply with their constraints or have an illegal state (e.g: A reference block is referencing a block that was hidden). In that case, you should go through them, rather fixing the issue or removing the constraint if it’s no longer necessary. Once they’re all resolved, you should be able to commit again and publish your changes.

Discarding changes

To discard your current changes, click on the

Discard Icon
. Be careful: this action cannot be undone and will permanently delete all uncommitted changes.

Choose what to commit

If you did a lot of updates or worked alongside a team member and you only want to commit a portion of the current changes list, then you can cherry pick them via the choose what to commit feature. The changes left aside won’t go anywhere they’ll be keep as work in progress until you commit them or manually discard them.

Related Articles

Did this answer your question?
BaseHub Help CenterBaseHub Help Center© BaseHub Corp. All rights reserved.