# Cloning Repositories

## Overview

Cloning creates a copy of your remote repository on your local file system. When you clone a repository, you will copy the most up to date version of your files to your local machine as well as the history of changes to those files.

{% embed url="<https://www.youtube.com/watch?v=Zz452vXQETg>" %}

{% hint style="info" %}
Both local and remote repositories are complete repositories. Git-based collaboration is based on 1:1 relationships between repositories, enabling you to push or pull commits directly between local and remote repositories.
{% endhint %}

## Cloning a Repository <a href="#cloning-a-repository-from-copia-web-app" id="cloning-a-repository-from-copia-web-app"></a>

There are two ways to clone a repository. You can start from the Web App and identify a repository you want to clone. Alternatively, you can clone from the Desktop App and search for a repository from the Copia server.

### Choosing a Repository from the Web App

Log into the Desktop App if you haven't done so already.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FqT3FIpIh9q59948S7WwL%2FDesktopApp_SignIn_Credentials.png?alt=media\&token=098769a3-c6e5-41c8-bf74-454779d387f7)

In the Web App, navigate to the repository you wish to clone. Click on the *Create Clone* dropdown and select the *Open in Desktop App* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FhJ7zLYCs8tpKPG28cHFO%2FWebApp_OpenInDesktopApp.png?alt=media\&token=9b7d92d9-d084-431b-a519-ed0453c69171)

You should be presented with a dialog that pre-populates the URL for the repository you started cloning.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2F9eULqOOkMHXjSBVJKPf7%2FDesktopApp_SelectPath01.png?alt=media\&token=85f6459c-69f7-4516-91e8-6cedf528269f)

If for some reason the URL does not appear or is incorrect, you can manually copy the repository URL by clicking the *Copy* button under the *Create Clone* dropdown. This URL would need to be pasted into the *Repository URL* field in the Desktop App.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FkbidKmvq6zSayC2nbdtg%2FWebApp_CopyURL.png?alt=media&#x26;token=409cedbf-921f-4fb6-966b-a74ab908d367" alt=""><figcaption></figcaption></figure>

You can also elect to change the *Local Path*. Make any necessary updates and then press the *Clone* button.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2Fo7aKJRFYJrS8KykOe2aO%2FDesktopApp_SelectPath_02.png?alt=media&#x26;token=7fe69e26-8d0d-4b15-8bdf-fd131ca7af68" alt=""><figcaption></figcaption></figure>

Your cloned repository will appear in the Desktop App. You can manage your cloned repositories by clicking the *Current Repository* dropdown and making another selection.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FSGAtItaFALL1SJqCC3tl%2FDesktopApp_TutorialRepository.png?alt=media\&token=d4f63024-33a5-4449-bb94-fb3fc05e5f94)

### Choosing a Repository from the Desktop App <a href="#cloning-a-repository-from-desktop-app" id="cloning-a-repository-from-desktop-app"></a>

Log into the Desktop App if you haven't done so already.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FqT3FIpIh9q59948S7WwL%2FDesktopApp_SignIn_Credentials.png?alt=media&#x26;token=098769a3-c6e5-41c8-bf74-454779d387f7" alt=""><figcaption></figcaption></figure>

In the Desktop App, navigate to the *File* dropdown and choose the *Clone repository...* option. You can select your repository from the list that appears under the *app.copia.io* tab. Ensure that the *Local Path* for the repository is correct and press the *Clone* button.

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FDZzaqdxqoKk7qlUDX9fG%2FDesktopApp_FilterRepositories.png?alt=media\&token=1f6ea461-60a1-49eb-880b-2a3bdca3ebe9)

The cloning process should begin and you will soon see your example repository rendered in the Desktop App. You can manage your cloned repositories by clicking the *Current Repository* dropdown and making another selection.

<figure><img src="https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FYLTBIbHyLXPAY6aiQPPz%2FDesktopApp_TutorialRepository.png?alt=media&#x26;token=a5054b4f-8cd9-42a8-b7ac-3458d1dc9b9e" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.copia.io/docs/git-based-source-control/basic/create-a-new-repository/cloning-a-repository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
