How to Use Git With Bolt.new
Bolt.new helps you create and change software with AI, but a working preview is not a substitute for version history. Git gives you reviewable checkpoints, a way to isolate experiments, and a dependable path for collaborating on the project. This guide covers how to get a Bolt.new project into a Git-backed workflow and how to keep generated changes safe as you iterate.
Practice Git workflows →Choose one source of truth for your project
Use the GitHub connection or export options available in your current Bolt.new project to put its source in a repository you control. Product interfaces and connection flows can change, so follow the current prompts in Bolt.new and confirm the GitHub repository and branch before connecting or importing.
If you connect a repository and also download a separate copy, decide which copy is authoritative before making edits in both places. Two independent copies can diverge, making it unclear which one contains the latest work. For a local checkout, clone the repository and work from that folder; for a hosted workflow, keep using the connected repository and verify each sync.
Check the repository before the next AI change
In a local checkout, open a terminal at the project root and check the current branch and working tree:
git rev-parse --show-toplevel
git branch --show-current
git status --shortIf the project is not yet a Git repository, follow the step-by-step guide to upload a project to GitHub. Before initializing or pushing, review the project files and exclude local settings, generated output, and credentials that do not belong in source control.
Make a branch for a feature or experiment
Before a larger redesign or new feature, start a branch from the project state you intend to build on:
git switch -c feature/product-filterKeep the task focused. Ask Bolt.new to make one coherent change, check its preview, and compare the source against the previous version before starting the next request. A branch isolates commits, but uncommitted edits still need to be reviewed and preserved.
Review generated files and changes before committing
After Bolt.new changes the project, inspect what Git sees:
git status --short
git diff --stat
git diff- Review the actual code, not just the rendered preview.
- Check new and untracked files, since they are not shown in the ordinary diff.
- Look for unexpected dependencies, generated files, debug code, or changes outside the requested feature.
- Run the project's available tests or build checks and inspect the output before accepting the changes.
Keep API keys and secrets out of the project history
Never paste a live API key into generated frontend code or commit it in an environment file. Browser-facing variables are visible to users even if their names suggest they are private. Use the provider's supported server-side secret configuration, and verify local secret files are ignored before staging:
git check-ignore -v .env.local
git status --shortIf a credential was committed or pushed, removing it from the current files is not enough. Revoke or rotate it first, then follow the appropriate guide to removing an API key from GitHub.
Commit a useful checkpoint and verify GitHub
Once you have reviewed and tested a coherent change, stage only the files you intend to keep and inspect the staged diff:
git add path/to/changed-file
git diff --cached
git commit -m "Add product filtering"Replace the example path and message with your actual change. If Bolt.new synchronizes with GitHub through a connected repository, confirm the commit or update appears on the intended branch. For a local workflow, verify the remote before pushing with git remote -v; then use git push when you are ready to publish.
Bolt.new and Git FAQ
Is a Bolt.new project automatically backed up by Git?
Do not assume it is. Confirm the project is connected to the repository you expect, and verify that the commits or files are present there. A local or hosted preview alone does not establish that your work is in GitHub.
Can I use GitHub without downloading the project?
Use the integration and export options currently available in Bolt.new. If you also work locally, clone the same repository and avoid editing separate copies without a plan for synchronizing them.