> ## Documentation Index
> Fetch the complete documentation index at: https://dhiwisepvtltd-5e04e6a4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# From GitHub

> Connect a Next.js TypeScript repository from GitHub and keep iterating with Rocket.new AI - chat edits sync back to your existing codebase.

> [!NOTE]
>
> Bring your existing code into Rocket. Clone a Next.js TypeScript repository from GitHub and pick up where you left off. Rocket imports your task files, installs dependencies, and sets up a live preview so you can start iterating with AI immediately.
>
> This is available for **Next.js + TypeScript tasks only**.

## Prerequisites

Before importing, make sure you have:

* A [Rocket](https://rocket.new) account
* A GitHub account with access to the repository you want to import
* A **Next.js project using TypeScript** (other frameworks and JavaScript-only projects are not supported)

> [!NOTE]
>
> If you have not connected GitHub to Rocket yet, you will be prompted to authorize during the import flow. See [GitHub connector](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/github/overview.md) for details on permissions and setup.

## Import a repository

**1. Go to Rocket**

Visit [rocket.new](https://rocket.new), sign in, and click the **Build** tab below the input.

**2. Open the GitHub import option**

Click the **+** button at the lower left of the input box and select **Clone from GitHub**.

![Rocket homepage with the + menu open, highlighting the Clone from GitHub option.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/create/from-github/web-browser/clone-from-github-light.webp)

![Rocket homepage with the + menu open, highlighting the Clone from GitHub option.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/create/from-github/web-browser/clone-from-github-dark.webp)

Click + then select Clone from GitHub

> **[Connect GitHub first](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/github/overview.md)**
>
> If you have not connected GitHub yet, Rocket will prompt you to authorize. Follow the connector setup guide for details.

**3. Pick a repository**

A dialog opens listing your GitHub repositories. Select the Next.js TypeScript task you want to import and click **Submit**.

![GitHub repository selection dialog with a dropdown to pick a repository and branch.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/create/from-github/web-browser/select-repository-light.webp)

![GitHub repository selection dialog with a dropdown to pick a repository and branch.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/create/from-github/web-browser/select-repository-dark.webp)

Select a repository to clone

**4. Wait for setup**

Rocket validates the repository, clones it, installs dependencies, and generates a live preview. This may take a moment depending on task size.

**5. Start building**

Once the preview is ready, use the chat to iterate on your imported task just like any other Build task.

## What gets imported

| Imported | Not imported |
| :- | :- |
| All task files and folders | GitHub Issues and Pull Requests |
| `package.json` dependencies | CI/CD workflow files (GitHub Actions) |
| Environment variable keys and values | Git history (only the latest state is imported) |
| Task structure and routing | Branch-specific content (only the default branch) |

> [!NOTE]
>
> Environment variable values from your `.env` file are imported automatically. Review them under [Environment variables](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/editor/env-variables.md) after importing.

## After importing

Once your task is in Rocket, you get full two-way sync with GitHub:

* **Rocket to GitHub:** Rocket pushes changes to the `rocket-update` branch and automatically opens a pull request to `main` for each batch of code edits (manual changes, visual edits, and AI-generated).
* **GitHub to Rocket:** Pull in the latest state of `main` made in your local IDE or by teammates without leaving Rocket.

> Learn how two-way GitHub sync works for Next.js TypeScript projects.
>
> [Open](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/github/code-sync.md)

## Disconnect from GitHub

GitHub is connected at the workspace level. Disconnecting removes the GitHub link for your entire Rocket account.

> **[Disconnect a service](https://dhiwisepvtltd-5e04e6a4.mintlify.site/getting-started/workspace/connectors.md#disconnect-a-service)**
>
> Disconnect or switch accounts from workspace Settings.

Your task files in Rocket remain intact after disconnecting. To reconnect, go through the same steps and authorize a GitHub account.

## When to use this vs other starting methods

| Starting method | Best for |
| :- | :- |
| **From GitHub** | You already have a Next.js TypeScript codebase and want to enhance it with AI |
| [From an idea](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/create/from-an-idea.md) | Starting fresh with a plain-language description |
| [Redesign](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/create/commands/redesign.md) | Rebuilding or redesigning an existing website |
| [From a template](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/create/using-templates.md) | Launching quickly from a pre-built starting point |

## What's next?

> **[GitHub sync](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/github/code-sync.md)**
>
> Push and pull changes between Rocket and GitHub.

> **[Environment variables](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/editor/env-variables.md)**
>
> Review and manage your environment variables after importing from GitHub.

> **[The chat](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/editor/chat.md)**
>
> Iterate on your imported project using natural language.

> **[Code tab](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/editor/code.md)**
>
> Browse and edit your project files directly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.