# Pulling

## Overview

Pulling gives you a local snapshot of your remote repository. It is automatically performed after you clone.  It is an operation performed via the Copia Desktop App on your local PC.

Each time you intend to make changes to a repository from a given machine, you'll want to pull changes locally. This way, multiple engineers from the same team can reference and collaborate on the same remote repository.

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

## Pulling <a href="#pulling-in-desktop-app-no-local-changes" id="pulling-in-desktop-app-no-local-changes"></a>

Once you start to collaborate with other users, you'll both be making changes to the same repository and often at the same time. In order to stay synchronized, you should make a habit of always pulling before pushing. This gives you an opportunity to check for remote changes before you try to push changes you've made locally, and it ensures that your local repository will always be up to date with what's on Copia's servers.

### Pulling when No Local Changes Exist

Pulling changes when you have no local changes is straightforward.

To pull changes from the Copia server, press the *Fetch Origin* button. The Desktop App will check the remote repository for any changes.

![](/files/OPBM7dkcB9SmfQnWKDL7)

This fetching operation only checks the remote repository; it doesn't bring in the changes locally. You therefore still need to pull the remote changes. To do so, press either of the *Pull Origin* buttons.

![](/files/T9pLyTMdrMbYQbBthijf)

### Pulling when Local Changes Exist

If you've made changes locally and in that time someone else on your team has also pushed their change to remote, you will first need to commit (or save your change) locally, and then pull changes from remote.

{% hint style="info" %}
To learn more about commits, check out the [Committing](/docs/git-based-source-control/basic/making-changes/saving-changes.md) section.
{% endhint %}

## Managing Merge Conflicts <a href="#merge-conflicts" id="merge-conflicts"></a>

At times, when you attempt to pull, you'll discover that you've modified a file that someone else has already modified. You'll get the following warning.

![](/files/A4mWgZ1Krrr5UaN0X52H)

You'll want to select your local version (the option NOT prefixed with `origin/`) and merge the files in. This will create a new commit. You can then navigate to the *History* tab to understand what you changed. We recommend you create another commit with the changes from remote that you overrode before pushing.

{% hint style="info" %}
While this process can be confusing, we recommend that you begin to use [branching](/docs/git-based-source-control/advanced/branching.md), [code review](/docs/git-based-source-control/advanced/code-review.md), and [merging](/docs/git-based-source-control/advanced/merging.md) flow which make it much cleaner to compare changes and resolve merge conflicts.
{% endhint %}


---

# 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/making-changes/getting-changes.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.
