Git Workflows for v0

v0 has two-way git sync, which allows you to work both in v0 in your browser and in a local code editor.

When you sync to a branch

  • every time v0 generates code, it will auto-commit it to the branch
  • every time an external commit is pushed to the branch, v0 will pull the latest code

You can choose the branch you connect to, and you can toggle auto-commit on or off. You currently cannot turn off the auto-pull, and instead need to unlink the branch.

Dev branch workflow


This is a more robust workflow I would recommend for any serious project and especially any project involving multiple people.

  1. Sync v0 to a specific development branch named for v0 and for a feature or task, like jacobparis-v0-user-growth-chart
  2. All of your code will be auto-committed to it as you send each message, and you can publish from v0 only for previews to share work in progress with your team.
  3. When you’re happy with your code, you can create a pull request within v0 to propose merging your branch into the main branch.
  4. You and your team can all review the PR to make sure the code is good. LLMs are prone to making mistakes. If an important file was deleted or overwritten, you’ll notice at this step and can simply undo that change.
  5. Merge to main
  6. For your next task, decide whether you’ll do it in v0 or locally, make a new branch for it, and code away

Some features will make more sense to do locally than in v0, but with this workflow can you choose on a task-by-task basis and still maintain a high code quality.

Main branch workflow


I only recommend this workflow for solo “vibe coding” projects (which may include the first commits to brand new team projects that don’t have anyone else working on them yet)

When synced to the main branch, you can prompt normally in v0 to build out your app and simply treat the git sync like a backup that will keep records of every version of your codebase for you.

You can deploy/publish straight from v0 at any time. I recommend always forking chats after a deploy to keep your chat history short and focused.

When you’re finished working in the v0 preview, you can switch to your local code editor and push code to the same main branch, at which point v0 will sync and pull that code in.

Warning: if you make edits in v0 in design mode or by manually editing code, these are not synced automatically.

  • So if v0 decides to pull from the repo, it may overwrite these edits.
  • Before you switch to local development, send a small prompt through v0 to make it generate something and it’ll push your edits along with its own.

Importing non-v0 codebases


v0 currently only supports git sync with repositories created by v0. Overcoming this limitation is on the roadmap, but not here yet

One trick I like to do is to ask v0 for something simple (“make a red button”) and then use git sync to create a mostly empty repository.

Then I can clone that repo into my local dev environment and do whatever I want with it

  • copy an existing code template
  • run a quickstart for a library
  • steal files from my other projects

After committing and pushing those, v0 will sync them and if I’m lucky, it’ll all work in the preview.

This isn’t an officially sanctioned approach because it bypasses all of v0’s safeguards against generating code it can’t run in its browser preview environment, so don’t expect to be able to import every repo this way.