---
title: Git Import
description: Import existing GitHub repositories into v0 to work on your actual codebase.
product: v0
type: guide
prerequisites:
  - /docs/quickstart
related:
  - /docs/github
  - /docs/projects
---

# Git Import



Git Import allows you to bring any GitHub repository into v0 and work on your existing codebase. View your project, edit it with AI assistance, and ship changes to production—all without leaving v0.

## What repositories can be imported?

You can import any GitHub repository that you have access to, including:

* **Public repositories:** Any public repo on GitHub
* **Private repositories:** Repos in your personal account or organizations where you have access
* **Monorepos:** v0 supports monorepos and lets you select which root directory to work with

To import a repository, you need to have the [Vercel GitHub App](https://github.com/apps/vercel) installed with access to that repository.

<Callout>
  If you don't see a repository in the import list, check that the Vercel GitHub App has access to it in your [GitHub App settings](https://github.com/settings/installations).
</Callout>

### Direct access vs. cloned repositories

Depending on your permissions, v0 works with repositories in two different ways:

* **Direct access (write permissions):** If you have write access to the repository, v0 works directly on it. Changes are pushed to branches in the original repository, and you can create pull requests directly.

* **Cloned to your account (read-only access):** If you only have read access (e.g., a public repo you don't own), v0 automatically clones the repository to your GitHub account. Changes are made in your cloned copy, and you can submit contributions back to the original repo via fork-based pull requests.

This means you can work on any repository—whether you own it, collaborate on it, or just want to explore and modify an open source project.

## How to import a repository

There are two ways to import a GitHub repository:

### Import from URL

1. Open the **Git Import** dialog from the attachment menu in a new chat
2. Paste the full GitHub URL (e.g., `https://github.com/myorg/myrepo`)
3. Click **Import**

### Search and select

1. Open the **Git Import** dialog
2. Select your GitHub account or organization from the dropdown
3. Search for the repository by name
4. Click **Import** on the repository you want

## Connecting to a Vercel Project

When you import a repository, v0 checks if it's already connected to a Vercel Project. This determines your import options:

### Importing with an existing Vercel Project

If the repository is already linked to one or more Vercel Projects, you can choose to connect your v0 chat to an existing project. This gives you:

* **Environment variables:** All environment variables configured in the Vercel Project are automatically available in v0, both in the editor and when deployed
* **Integrations:** Connected integrations (Supabase, Stripe, databases, etc.) work immediately without additional setup
* **Production deployments:** When you merge changes to main, your production deployment is automatically updated
* **Custom domains:** Any custom domains configured on the Vercel Project are available for your deployments

### Creating a new Vercel Project

If no Vercel Project exists for the repository, or if you want a fresh setup, v0 will create a new project for you. You can:

* Name your new project
* Select the base branch to work from
* Choose the root directory for monorepos

<LearnMore href="/vercel-integration" icon="arrow">
  Learn more about how v0 and Vercel Projects work together
</LearnMore>

## Branching workflow

When you import a repository, v0 automatically creates a dedicated branch for your work:

1. **Select a base branch:** Choose which branch to start from (e.g., `main`, `develop`)
2. **Auto-created working branch:** v0 creates a branch like `v0/main-abc123` for your changes
3. **Protected base:** Your base branch is never modified directly
4. **Merge via PR:** When ready, create a pull request to merge your changes

This workflow keeps your main branch safe while you iterate with AI assistance.

<LearnMore href="/github" icon="arrow">
  Learn more about v0's Git integration
</LearnMore>

## Preview environment

Git Import uses Vercel Sandbox to power its preview environment. This VM-based approach closely mimics your local development environment, providing:

* **Full Node.js runtime:** Run your actual dev server, not a simulated environment
* **Real dependency installation:** Your `package.json` dependencies are installed just like locally
* **Background processes:** Support for dev servers, watchers, and other background tasks
* **File system access:** Full read/write access to your project files

This means the preview you see in v0 behaves the same way your app would when running `npm run dev` on your machine.
