If you’re new to version control and GitHub, we strongly recommend reading our Introduction to version history, version control, and GitHub to get familiar with the basics.
When you connect Bolt to GitHub, your work is automatically backed up with a full history of changes. This means you’re never locked into using Bolt. You can build in Bolt, switch to working directly in GitHub, and then come back to Bolt whenever you want. And since your code lives in GitHub, you can publish your site with other services too, not just through Bolt hosting or the Bolt/Netlify integration. The GitHub connection is designed to:
  • Keep things simple: Bolt handles the tricky parts of Git for you.
  • Keep branches separate: Each branch has its own memory, so nothing “bleeds over” between them.
  • Give you control: You decide which projects connect to GitHub.
You can bring an existing GitHub project into Bolt, or start fresh in Bolt and create a new GitHub repository for it.

Connect GitHub

To connect your GitHub account to Bolt, you’ll first need an individual GitHub account.
Bolt currently doesn’t support GitHub organization accounts.
Sign up for one if you don’t already have one. To connect an individual GitHub account to Bolt, follow these steps: Screenshot showing GitHub menu option within top Integratiosn menu in Bolt.new
  1. Log in to your Bolt account and open a project.
  2. Click Integrations > GitHub in the top-right corner of your screen.
  3. Click Log in to GitHub.
  4. Click Authorize stackblitz. (StackBlitz is Bolt’s parent company.)
  5. Follow any further verification steps required.

Create a new repository from a Bolt project

Prerequisite: You must have GitHub connected to Bolt.
To create a repository from your Bolt project:
  1. Log in to your Bolt account and open the project you want to link with a new GitHub repository.
  2. Click Integrations > GitHub in the top-right corner of your screen. Int Git Pn
  3. In the Create a repository window that appears, enter a name for your new repository. Screenshot of Create a GitHub repository Bolt window
  4. Click Create repository
  5. Click Start building to return to Bolt.
The repository starts as private, on a main branch. You can set the repository to public in your GitHub settings, and you can create new branches in Bolt or on GitHub. See Branching and merging for more information.

Import an existing repository

To import a project into Bolt from one of your GitHub repositories, follow the steps below: Bolt homepage with arrow pointing to GitHub import icon below chatbox
  1. On the Bolt.new homepage, click the GitHub icon below the primary chatbot.
  2. Choose how you want to import:
    • Use the drop-down menu to select the repository you’d like to import, or
    • Click the Import from URL button, then enter your GitHub repository URL.
  3. Click Choose this repository.
  4. Bolt will load your repository as a new Bolt project.

Disconnect GitHub

Fully removing your GitHub integration is a one-step process if you used your GitHub account to create your Bolt account, or a two-step process if you did not. Either way, start by following the steps below:
1

Revoke access in GitHub

  1. Log in to GitHub.
  2. Click your profile icon in the top-right corner of your screen.
  3. Click Settings.
  4. Click Applications in the left-side navigation menu (likely near the bottom of the menu).
  5. Click the Authorized GitHub Apps tab.
  6. Click Revoke in the Bolt/StackBlitz row.
  7. Click I understand, revoke access.
If you signed up for your StackBlitz/Bolt account with GitHub, you do not need to perform Part 2. If you signed up using Google or email, you will to complete the process.
2

Delete the GitHub connection in StackBlitz

  1. Log in to StackBlitz.
  2. Click Settings in the left navigation menu.
  3. Click the Credentials tab.
  4. Click Delete in the GitHub section.
If you added a second email to your account specifically for GitHub, you can go to Settings > Profile to delete it from your account.

Branching and merging

When you create or import a repository in Bolt, you’ll start on the main branch. This is usually the live version of your project. You can do all your work on main, or create branches. Branches allow you to:
  • Work with others without overwriting each other’s changes.
  • Work on different features separately, so unfinished work doesn’t go live.
    For example, if you’re building three new features on the main branch, you’d have to finish all three before publishing. With branches, you can finish and merge each one into main as they’re ready.

Create a new branch in Bolt

Prerequisite: You must have GitHub connected to Bolt and a repository already created.
  1. Log in to Bolt and open a project that is already linked to a GitHub repository.
  2. Click the GitHub icon in the top-right of your screen. Screenshot showing location of GitHub icon when connected to a repository
  3. Click Create new branch.
  4. Enter a branch name.
  5. Click Create branch.
You’re now working on your new branch, which is also created in your GitHub repository.

Change branches in Bolt

Prerequisite: You must have GitHub connected to Bolt, a repository already created, and multiple branches created.
  1. Log in to Bolt and open a project that is already linked to a GitHub repository.
  2. Click the GitHub icon in the top-right of your screen. Github Branch Pn
  3. Select the branch you want to switch to.
Bolt currently doesn’t support merging branches in-app. You need to merge branches in GitHub.

Committing and fetching

Bolt saves your work automatically. Every time you make a change that doesn’t break the project, Bolt creates a commit for you. It also checks GitHub every 30 seconds for any updates made outside Bolt and pulls those in.
Very rarely, both Bolt and GitHub might update at almost the same time. If that happens, Bolt will keep your changes and overwrite the GitHub version.