# Folders and repositories

Link code on your Mac, add a hosted repository, or clone a local copy.

Use **Sources** to connect a project to its code. Choose the option that matches where the code lives:

| You have… | What to do |
| --- | --- |
| Code already on your Mac | Link its local folder. |
| A repository on GitHub, GitLab, or another Git host | Add its remote URL. This saves a reference to the repository. |
| A remote repository you want to work on locally | Add it, then use **Clone repository** to download a local copy. |

You can link several repositories and folders to one project. Repository activity, such as issues and build results, also needs a [GitHub or GitLab connection](/guide/connections/git-providers/).

## Add sources

1. Open **Sources → Add source**.
2. To add a repository, use **Add remote URL** under Repositories or select one from a connected account.
3. To link code already on your Mac, use **Choose folder** under Local folders.
4. Choose the repository associated with each folder, if applicable.
5. Select **Save sources**.

Several folders can belong to the same repository. A folder can also have no linked repository. Adding a folder reads project metadata; it does not move files into Orbit.

## Clone a repository

From the repository's menu, choose **Clone repository**, select the parent folder where you want the code, then confirm. Orbit creates a local copy, called a checkout, and links it to the project. Private repositories use your local Git credentials, independently of the token used to read repository activity.

Cloning writes a new checkout to the chosen location. A remote URL alone does not clone anything.

## Open and change a folder

Select **Open folder** to open an available local folder. Folder opening requires the desktop app and access to the saved path.

If you move a checkout or restore a workspace on another machine, use the folder menu's **Change folder location** or **Relink** in the sources dialog. Choose its replacement path and save. This changes Orbit's reference; it does not move or delete files.

Use **Link repository** or **Change repository** in the folder menu to update the association without moving the folder. This is helpful when several repositories or checkouts belong to one project.

## Remove a source

Choose **Remove folder** or **Remove repository** from its menu and confirm. Removing a folder leaves its files on disk. Removing a repository keeps the remote repository and local folders; it removes the project association.

Provider activity is a separate connection. Changing a repository URL can require enabling activity again for the new remote. Review its activity settings after changing sources.
