Bolt.new has no native Mercurial integration — only GitHub is natively supported. To use Mercurial with a Bolt project, export the project as a ZIP file, extract it locally, and initialize a Mercurial repository with hg init. Push to Bitbucket (which still supports Mercurial) or a self-hosted Hg server. For teams with existing Mercurial infrastructure, this manual workflow is functional but more cumbersome than Git. Most users should use Bolt's native GitHub integration instead.
Using Mercurial Version Control with Bolt.new Exported Projects
Mercurial was once a major force in version control, used by prominent technology companies and beloved for its clean command-line interface and consistent behavior. In 2025-2026, Mercurial usage has declined significantly — Bitbucket removed Mercurial support in 2020 (though community-maintained Mercurial hosting remains available), and most organizations have migrated to Git. However, some enterprises with legacy infrastructure, particularly those that built tooling around Mercurial workflows, still use it actively.
Bolt.new's version control integration is GitHub-only. The Git panel in Bolt's editor connects to GitHub via OAuth and pushes to GitHub repositories with one click. There is no equivalent for Mercurial, GitLab (which also requires the manual path), Bitbucket, or any non-GitHub Git host. This is a deliberate design decision — GitHub's dominance and Bolt's integration with the broader GitHub ecosystem (Actions, Copilot, Pages) makes it the obvious choice for Bolt's target audience.
For teams committed to Mercurial, the workflow described in this guide works reliably — it is just more manual than the native GitHub integration. The core pattern is: build features in Bolt, export the updated project as a ZIP, extract the changes, review what changed, commit to Mercurial, and push to your Hg host. This is the same pattern required for GitLab, Bitbucket, and any other non-GitHub version control system. The primary trade-off is speed: Git users push from Bolt in one click; Mercurial users export, extract, and commit manually.
Integration method
Mercurial has no direct integration with Bolt.new. The workflow uses Bolt's ZIP export feature to download the project, then standard Mercurial commands to initialize a repository and push to Bitbucket or a self-hosted Hg server. Unlike Git, which has native one-click push support in Bolt's Git panel, Mercurial requires the manual download-extract-commit cycle for every update from Bolt. Teams with existing Mercurial infrastructure can maintain this workflow, but migrating to Git unlocks Bolt's native integration.
Prerequisites
- A Bolt.new account with a project ready to version control
- Mercurial installed locally — download at mercurial-scm.org (available for Windows, macOS via Homebrew, Linux via package manager)
- A Mercurial hosting account: Bitbucket no longer supports Mercurial directly, so use RhodeCode (free community edition at rhodecode.com), Kallithea, or a self-hosted Hg server
- Basic familiarity with the terminal and command-line tools
- Optional: hg-git extension if you want to bridge between Mercurial and GitHub repositories
Step-by-step guide
Understand the Landscape: Mercurial in 2026
Understand the Landscape: Mercurial in 2026
Before committing to a Mercurial workflow for Bolt projects, it is worth understanding the current state of the Mercurial ecosystem. This context will help you decide whether to proceed with Mercurial or migrate to Git. Mercurial itself is still maintained — the mercurial-scm.org project continues releasing updates, and the core VCS works well for teams that have invested in it. The tool is conceptually simpler than Git in several ways: the mental model of changesets, bookmarks instead of branches for most workflows, and more consistent command behavior across platforms. However, the hosting landscape has changed significantly. Bitbucket dropped Mercurial support in June 2020 — the platform is now Git-only. Organizations that were Bitbucket-Mercurial users had to migrate somewhere: many chose GitHub or GitLab (converting to Git), some set up self-hosted Mercurial servers using RhodeCode or Kallithea, and some moved to Sourcehut (which supports Mercurial natively). For Bolt.new specifically, the decision point is straightforward. If your organization has active Mercurial infrastructure with custom tooling, CI/CD pipelines, and workflows that would be expensive to migrate, the manual export workflow described here is a reasonable solution. If you are starting fresh or could migrate with modest effort, using Git and Bolt's native GitHub integration gives you one-click pushes, automatic deploys via Netlify, and access to the GitHub Actions ecosystem. Most new Bolt users should use GitHub. This guide is for the Mercurial cases where migration is not practical in the short term.
1# Install Mercurial:2# macOS (Homebrew):3brew install mercurial45# Ubuntu/Debian:6sudo apt-get install mercurial78# Verify installation:9hg --version10# Should print: Mercurial SCM (version 6.x.x)Pro tip: If you are evaluating whether to use Mercurial or Git, consider the hg-git extension (bitbucket.org/durin42/hg-git), which lets you push and pull from Git repositories using Mercurial commands. This bridges both worlds: use Mercurial locally while pushing to GitHub for Bolt's native integration.
Expected result: Mercurial is installed and the hg --version command prints a version number. You have decided whether to proceed with native Mercurial or use hg-git as a bridge to GitHub.
Export Your Bolt Project
Export Your Bolt Project
Bolt's native GitHub integration (the Git panel) only works with GitHub. For Mercurial, you use the manual export workflow: download the project as a ZIP file from Bolt's toolbar. In your Bolt project, click the download icon in the top toolbar — it typically appears as a downward-pointing arrow or a box with an arrow. Bolt packages your entire project file system (all source files, configuration files, package.json) into a ZIP archive and downloads it to your browser's default download location. Notable items NOT included in the Bolt ZIP export: node_modules/ (correct — you will run hg add and the .hgignore will exclude this), the Bolt Secrets tab values (your API keys and environment variables — you will need to recreate these in a local .env file), and Bolt's internal Version History (this is Bolt's internal undo system, not part of the exported code). After downloading, create an organized folder structure on your local machine for managing Bolt exports. A dedicated directory like ~/projects/bolt-projects/ with a named subfolder for each project works well. Extract the ZIP into this folder, preserving the original project folder structure. Before initializing the Mercurial repository, take a moment to review what was exported by running ls -la in the project directory. You should see standard Vite or Next.js project files: package.json, src/, public/, configuration files (vite.config.ts or next.config.js), and other project-specific files. The presence of package.json is important — it confirms Bolt exported a proper Node.js project that Mercurial (or any VCS) can version control.
1# Create a projects directory and extract the Bolt ZIP:2mkdir -p ~/projects/bolt-projects/your-project-name3cd ~/projects/bolt-projects/your-project-name45# On macOS, unzip the downloaded file:6unzip ~/Downloads/bolt-project-export.zip -d .78# Verify the project structure:9ls -la10# Expected: package.json, src/, public/, vite.config.ts or next.config.jsPro tip: If the Bolt ZIP extracts into a nested subfolder (e.g., bolt-project-export/my-project/), move all files up one level so package.json is directly in your project directory, not in a subdirectory.
Expected result: The Bolt project is extracted to a local folder. All source files are present, package.json is in the project root.
Initialize a Mercurial Repository and Create .hgignore
Initialize a Mercurial Repository and Create .hgignore
With the Bolt project extracted locally, initialize a Mercurial repository and configure what should be tracked versus ignored. This is similar to how Git uses .gitignore, but Mercurial uses .hgignore with its own pattern syntax. Mercurial's .hgignore file supports two pattern syntax modes: regexp (regular expressions, the default) and glob (shell-style wildcards). For most Bolt project ignores, the glob syntax is more readable and easier to write. Specify the syntax at the top of the .hgignore file. Key directories and files to exclude from Mercurial tracking: node_modules/ (hundreds of megabytes of dependencies — always regenerated by npm install), dist/ and .next/ (build output — always regenerated by npm run build), .env and .env.local (API keys and secrets — never commit these to version control), and .bolt/ (Bolt's internal project metadata if it was included in the export). After creating .hgignore, run hg init to create the Mercurial repository, then hg add to stage all non-ignored files. Review what was staged with hg status — files marked with 'A' are added and will be included in the first commit. If any secret files or large binary files appear in the hg status output, add them to .hgignore before committing.
1# Navigate to the project directory:2cd ~/projects/bolt-projects/your-project-name34# Create .hgignore:5cat > .hgignore << 'EOF'6syntax: glob78# Dependencies (regenerated by npm install)9node_modules/10.pnp11.pnp.js1213# Build output (regenerated by npm run build)14dist/15build/16.next/17out/1819# Environment files (contain secrets)20.env21.env.local22.env.development.local23.env.test.local24.env.production.local2526# Bolt internal27.bolt/2829# macOS30.DS_Store3132# Logs33npm-debug.log*34*.log35EOF3637# Initialize Mercurial repository:38hg init3940# Add all non-ignored files:41hg add4243# Review what will be committed:44hg statusPro tip: Run 'hg status' and check every file listed before committing. Files marked 'A' are added. If you see node_modules/ or .env in the list, your .hgignore is not working correctly — double-check the syntax and file location.
Expected result: A Mercurial repository is initialized (.hg/ directory exists). hg status shows all source files as 'A' (added). No node_modules/, dist/, or .env files appear in the status output.
Make the Initial Commit and Push to a Hg Host
Make the Initial Commit and Push to a Hg Host
With files staged via hg add, make the initial commit with a descriptive message describing what this Bolt project contains. Then push to your Mercurial hosting platform. For self-hosted Mercurial: Kallithea, RhodeCode, and Gogs (which supports Mercurial) are common choices. Create a new repository on your hosting platform, note the SSH or HTTPS URL, and configure Mercurial's .hg/hgrc file with the remote URL. For Bitbucket alternative (since Bitbucket dropped Mercurial): Sourcehut (sr.ht) is a modern development platform that supports Mercurial natively alongside Git. Create an account at sourcehut.org, set up your SSH key, and push to a Mercurial repository. Sourcehut also has CI (builds.sr.ht) that can run npm run build on pushes. After the initial push, establish a routine for subsequent Bolt updates. When you make changes in Bolt and want to sync them to Mercurial: export a new ZIP from Bolt, extract it to a temporary folder, copy only the changed files over your existing Mercurial repository folder (or use diff/patch to identify and apply changes), then commit and push the updates. This is more manual than Git's approach but achieves the same version control result. An important consideration about the WebContainer limitation: Bolt's development environment cannot receive incoming webhooks or connect to external services using raw TCP. Once you export the project and push to your Mercurial host, any Hg-based CI/CD pipeline can build and deploy the app in a real server environment where these limitations do not apply. Your existing Mercurial-integrated build systems work normally with the exported Bolt code.
1# Make the initial commit:2hg commit -m "Initial commit: Bolt.new project export"34# Configure remote repository in .hg/hgrc:5# [paths]6# default = https://your-hg-host.com/yourname/your-project78# Using a text editor or command line:9cat >> .hg/hgrc << 'EOF'10[paths]11default = https://your-hg-host.com/yourname/your-project12EOF1314# Push to remote:15hg push16# For first push you may need:17hg push --new-branch1819# For subsequent Bolt updates:20# 1. Export new ZIP from Bolt21# 2. Extract and copy changed files to repo directory22# 3. Check what changed:23hg status24hg diff25# 4. Commit and push:26hg commit -m "Update: [describe what changed in Bolt]"27hg pushPro tip: Use 'hg diff' before every commit to review exactly what changed between Bolt exports. This helps you write meaningful commit messages and catch accidental changes (like a re-exported file that looks different due to whitespace changes).
Expected result: The initial commit is in your local Mercurial repository and pushed to the remote host. The project history shows the initial commit with all source files tracked.
Common use cases
Maintaining a Bolt Project in a Legacy Mercurial Repository
An organization with existing Mercurial infrastructure wants to use Bolt for frontend development while keeping all code in their Hg-based system. Export from Bolt periodically, commit the changes to the Mercurial repository, and use existing Hg-based CI/CD pipelines to build and deploy the updated application.
Copy this prompt to try it in Bolt.new
One-Time Export for Long-Term Local Development
Use Bolt to rapidly prototype an application, export the completed prototype to a Mercurial repository, and continue development using local tools and Mercurial for version control. Bolt is used for the initial build only; all subsequent development happens outside Bolt with Mercurial tracking changes.
Copy this prompt to try it in Bolt.new
Using Mercurial Alongside GitHub via Repository Mirroring
Connect Bolt to GitHub natively for one-click pushes, and set up Mercurial's hg-git extension or a Bitbucket mirror to sync the GitHub repository to your Mercurial infrastructure. This gives you Bolt's native GitHub integration while keeping your Hg-based workflows intact.
Copy this prompt to try it in Bolt.new
Troubleshooting
hg push fails with 'ssl: certificate verify failed' when pushing to a self-hosted Mercurial server
Cause: The self-hosted Mercurial server is using a self-signed SSL certificate that Mercurial cannot verify against its trusted certificate authorities.
Solution: For internal servers using self-signed certificates, add the certificate fingerprint to ~/.hgrc. Get the fingerprint with: openssl s_client -connect your-hg-host.com:443 < /dev/null 2>&1 | openssl x509 -fingerprint -noout. Then add it to ~/.hgrc under [hostfingerprints]. Alternatively, for a less secure but quick fix, add 'insecure = true' under [hostfingerprints] for the specific host.
1# Add to ~/.hgrc (global Mercurial config):2[hostfingerprints]3your-hg-host.com = SHA256:abc123...your-fingerprint-here45# Or for HTTP (not HTTPS) hosts:6[paths]7default = http://your-hg-host.com/yourname/repoAfter extracting a new Bolt ZIP over an existing repository folder, hg status shows hundreds of unexpected modified files
Cause: The Bolt ZIP export sometimes includes files with slightly different line endings or whitespace, making Mercurial detect them as modified even when the logical content has not changed.
Solution: Configure Mercurial's eol extension to normalize line endings. Add the eol extension to ~/.hgrc and create a .hgeol file in the project root that sets the line ending policy. This ensures consistent line endings regardless of whether files came from Bolt's export or manual edits.
1# .hgeol file in project root:2[patterns]3**.js = native4**.ts = native5**.tsx = native6**.json = native78# ~/.hgrc:9[extensions]10eol =The hg-git extension is not working for bridging Mercurial to GitHub for Bolt's native integration
Cause: The hg-git extension (dulwich) requires a compatible version of Python and the dulwich library to be installed. Version mismatches between Mercurial, hg-git, and dulwich are common.
Solution: Install hg-git using pip with the exact version compatible with your Mercurial installation: pip install hg-git. Enable it in ~/.hgrc under [extensions]: hggit =. If version conflicts persist, consider using git-remote-hg (a Git extension that enables git commands against Mercurial repos) instead, which goes in the opposite direction.
1# Install hg-git:2pip3 install hg-git34# Enable in ~/.hgrc:5[extensions]6hggit =78# Clone a GitHub repo using hg-git:9hg clone git+https://github.com/yourname/your-bolt-project.git1011# Push back to GitHub from Mercurial:12hg pushBest practices
- Use Git and Bolt's native GitHub integration if you have any choice in the matter — the one-click push in Bolt's Git panel is vastly faster than the manual ZIP export cycle required for Mercurial.
- If you must use Mercurial, consider the hg-git extension as a bridge: work in Mercurial locally but push to GitHub for Bolt's native bidirectional sync, avoiding the manual export cycle.
- Create a .hgignore file before the first hg add to prevent accidentally tracking node_modules/, .env files, and build output directories.
- Use descriptive commit messages that explain what changed from the Bolt perspective — 'Add payment integration step 3: webhook handler' is more useful than 'Update from Bolt export'.
- Keep Bolt exports dated and organized (bolt-export-2026-04-22/) in a separate folder from your Mercurial repository to make it easy to compare what changed between exports using hg diff.
- For teams with existing Mercurial CI/CD, verify that the CI system can build Vite and Next.js projects — Bolt generates modern JavaScript toolchains that require Node.js 18+ and may need CI configuration updates.
- Consider migrating to Git strategically — use the Bolt project as the opportunity to introduce Git in your workflow, since Bolt itself is the primary reason to be working with it.
Alternatives
Git has native one-click push support in Bolt's built-in Git panel and is the recommended version control system for Bolt projects — Mercurial requires the manual export workflow that Git completely avoids.
GitLab uses Git (not Mercurial) but also requires the manual export workflow since Bolt only integrates natively with GitHub — though GitLab's built-in CI/CD provides better automation after the initial push.
VS Code supports Mercurial through extensions like HG (hg.exe) and provides a GUI for common Mercurial operations after exporting your Bolt project, making the manual workflow more visual.
CircleCI can connect to Bitbucket and GitHub repositories (not self-hosted Mercurial), so the best integration path is exporting from Bolt to a Git host and using CircleCI for automated deployments.
Frequently asked questions
Does Bolt.new support Mercurial repositories natively?
No — Bolt.new only supports GitHub natively through its built-in Git panel. For Mercurial, you must use the manual export workflow: download the project as a ZIP, extract it locally, and use standard hg commands to commit and push. There is no planned Mercurial integration for Bolt based on current documentation.
Can I use Bitbucket with Bolt.new for Mercurial repositories?
Bitbucket removed Mercurial support in June 2020 and is now a Git-only platform. If you have an existing Bitbucket Mercurial repository from before 2020, it was archived and is no longer accepting pushes. For current Mercurial hosting, options include Sourcehut (sr.ht), RhodeCode, Kallithea, or a self-hosted Hg server. If you want to use Bitbucket with Bolt, you would use Bitbucket's Git functionality with the same manual export workflow.
Is it worth migrating from Mercurial to Git just to get Bolt's native GitHub integration?
For most teams, yes — especially if Bolt is going to be your primary development environment. The native GitHub integration saves significant time: one-click pushes, automatic Netlify deployments on every push, GitHub Actions for CI/CD, and no manual ZIP export cycle. Migrating a Mercurial repository to Git is straightforward using hg-fast-export or the GitHub Importer. The migration cost is typically a day of work for a small-to-medium project, after which the workflow is permanently faster.
Can the hg-git extension give me the same experience as Bolt's native GitHub integration?
Partially — hg-git lets you push Mercurial changesets to a GitHub repository, which would then trigger automatic Netlify deploys and allow Bolt to pull the changes. However, you lose the one-click push in Bolt's Git panel (you would push from your local terminal using Mercurial commands) and the bidirectional sync requires careful management of the Git-Mercurial bridge. It is more functional than pure Mercurial but still more complex than native Git.
How do I handle merge conflicts when multiple developers are updating the Mercurial repository between Bolt exports?
Mercurial handles merge conflicts similarly to Git — when two changesets modify the same file, hg merge creates a merge changeset that must resolve the conflict. For Bolt specifically: if a teammate commits changes to the Mercurial repo while you are building in Bolt, your next ZIP export may be based on an older state. After extracting the new ZIP, run hg pull and hg merge to incorporate the team changes, then resolve any conflicts manually before committing. This is the same challenge as with any VCS in a team environment.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation