# Create a repository

You need a verified email address to create a repository. To bring an existing
project from GitHub instead, see [GitHub import](https://git.cafe/docs/integrations/github-sync.md).

## Create a repository in the browser

1. Open `/new`.
2. Choose an owner: your account or an organization where you can create
   repositories.
3. Enter:
   - **Name**: unique within the owner.
   - **Visibility**: **Private** (the default) or **Public**.
   - **Default branch**: `main` unless you choose another name.
   - **Description**: optional.
4. Choose **Create**.

The new repository is empty. Its page shows the commands to push an existing
project or start a new one; see [Git access](https://git.cafe/docs/getting-started/git-access.md).
There are no README, license or `.gitignore` templates.

## Create a repository from the CLI

```sh
cafe repo create my-app --private --clone
```

`--org <slug>` creates it in an organization, `--default-branch` sets the
initial branch name, and `--clone` clones it into a new directory.

## Fork a repository

A fork is your own copy of another repository, linked to its parent so you can
propose changes back with a [pull request](https://git.cafe/docs/pull-requests/open.md#open-a-pull-request-from-a-fork).

1. Open the repository and choose **Fork**.
2. Choose the owner and, optionally, a new name.
3. Choose **Create fork**.

Or run `cafe repo fork owner/repo --clone`. Forking a private organization
repository requires the organization to allow it.

Forks copy only the parent's default branch unless you choose more. Use
`cafe repo fork owner/repo --branch feature --branch release` to include
additional branches, or `--all-branches` to copy every branch and tag instead.
The two selection flags cannot be combined. Selected branches do not copy tags.

Fork creation is asynchronous. The CLI prints a progress command:
`cafe repo fork --status <repoId> --org <destination-owner>`. It reads the
existing admission without starting another fork and shows its state, attempt
count, next retry and last error. `--json` includes those fields too. A blocked
admission has stopped; an uncertain outcome is retried until confirmed or blocked.

Copies yield between chunks within a three-minute attempt budget and request at
most two minutes per native fetch, leaving time for publication and private-source
credential cleanup. Completed ref batches survive a retry; interrupted pack
downloads do not resume. A single branch whose initial fetch cannot finish within
that budget will eventually block and needs an asynchronous native copy path,
which this workflow does not yet provide.

To bring your fork's default branch up to date with its parent, run
`cafe repo sync`; `cafe repo compare-upstream` shows how far ahead or behind
it is.

## Next steps

- Invite people in [access settings](https://git.cafe/docs/repositories/repository-access.md).
- Protect branches with [rulesets](https://git.cafe/docs/repositories/repository-rulesets.md).
- Change the description, visibility or default branch in
  [repository settings](https://git.cafe/docs/repositories/repository-settings.md).
