# Import from GitHub

> Bring an existing app's code into Draftship, keep building it with the AI, and push the changes back to its repository.


Already have an app on GitHub? Import it, and keep building it here with the AI.

## Import a repository

1. Choose **Import from GitHub** on **Projects**, or next to **Start a new app** on the dashboard.
2. The first time, choose **Connect GitHub** and allow Draftship on GitHub. You come back with the list open. Connecting is free on every plan.
3. Pick a repository from the list of every repository in your account: your own, ones you collaborate on, and your organizations'. Search to find one quickly. To import one folder of a larger repository, enter it under **Folder**, like `apps/web`.
4. Pick a model and, if you're in a team workspace, where the app goes. Then choose **Import**.

The code comes in, and the AI makes it run on Draftship, keeping its pages, features, text and look. Then it builds and checks the app like any other. An import counts as one message.

Private repositories work the same way. An organization's repositories appear once the organization allows Draftship in its GitHub settings. You can disconnect GitHub any time under **Settings → Integrations**.

## What comes in

- Text files, up to 400 of them and 6 MB in all: code, styles, content and config.
- The npm packages it uses, up to 15, as the app's package list.
- Draftship keeps its own `package.json`, lockfile, Next.js and TypeScript config, so the app builds here.
- Images, fonts and other files stay on GitHub, and the AI loads images from there.

Draftship apps are Next.js apps. A Next.js repository comes in almost as it is. Other React apps (for example Vite) are moved to Next.js by the AI, page by page.

## Push changes back

On **Pro+**, choose **Push** to send your changes back to the repository the app came from. They go to a branch called `draftship`, never to your main branch, and Draftship opens the page to create a pull request. Files you deleted in Draftship are deleted on the branch; the repository's other files stay as they are.

Draftship needs permission to write to the repository. If it doesn't have it, fork the repository and import your fork.
