# Git integration

{% hint style="info" %}
Overleaf's Git integration is a [premium feature](https://docs.overleaf.com/getting-started/free-and-premium-plans/premium-features). Overleaf premium features are available to participants in [Overleaf Commons](https://www.overleaf.com/for/universities), members of group [subscriptions](https://www.overleaf.com/for/groups), and owners of individual [subscriptions](https://www.overleaf.com/user/subscription/plans). Git integration is available on Overleaf Cloud and Overleaf Server Pro (version 4.0 and later).
{% endhint %}

## What is the Overleaf Git integration?

Overleaf's Git integration allows you to obtain a Git URL from your Overleaf project and treat it like a remote Git repository (repo). You can clone your project to a local Git repository and work on your project locally, pushing changes to your project from your local machine and pulling updates that are occurring in Overleaf's online editor to your local repo.

This allows you to work on your project locally for those times when online work is not feasible, to use a different local editor of your choice when working on an Overleaf project, or to easily add outputs from other local software to your Overleaf project.

You can obtain the Git URL and clone command for your project from the **Git** option located in **Integrations** on the left hand side

<figure><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FwesoeOROZ3O1kEE28ojm%2Fimage.png?alt=media&#x26;token=50556108-c606-4e6a-a5dc-c08c935cfc52" alt=""><figcaption></figcaption></figure>

## How to authenticate when using the Git integration

When you perform a Git operation such as clone, pull, or push to your remote Overleaf project, you will be asked to authenticate.

To access your Overleaf project from Git, you must use Overleaf token-based authentication. For step-by-step instructions see: [Git integration authentication tokens](https://docs.overleaf.com/integrations-and-add-ons/git-integration-and-github-synchronization/git-integration/git-integration-authentication-tokens).

## Cloning your project as a local repository

From the **Integrations** button within your project, select **Git** from the options. This will bring up a dialog showing the `git clone` command to use when creating your local repository.

<figure><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FP1Bjb90Hpy8W6gTiCrZN%2Fimage.png?alt=media&#x26;token=5a8a0295-d784-4502-b1d9-72c164a07bb3" alt=""><figcaption></figcaption></figure>

Alternately, you can find the Git URL from the project URL (the URL in the browser address bar when you're in a project).

## **Overleaf Cloud**

If you're using Overleaf Cloud and your Overleaf project URL looks like:

```
https://www.overleaf.com/project/1234567
```

Then the Git URL to use to clone the project will be:

```
https://git.overleaf.com/1234567
```

And the command used to clone the project into a local Git repository will be:

```
git clone https://git.overleaf.com/1234567
```

## **Overleaf Server Pro (version 4.0 or later)**

{% hint style="info" %}
Note: The Git-bridge integration is not enabled by default in Server Pro. Please see our [Git Integration](https://github.com/overleaf/overleaf/wiki/Git-Integration) guide for instructions on how to enable it.
{% endhint %}

If you're using Overleaf Server Pro and your Project URL looks like this:

```
https://<SHARELATEX_SITE_URL>/project/1234567
```

Then the Git URL used when cloning the project will be:

```
https://git@<SHARELATEX_SITE_URL>/git/1234567
```

And the command used to clone the project into a local Git repository using the Git command line will be:

```
git clone git@<SHARELATEX_SITE_URL>/git/1234567
```

{% hint style="info" %}
Note: You may be prompted for a password. Please see: [Git integration authentication tokens](https://docs.overleaf.com/integrations-and-add-ons/git-integration-and-github-synchronization/git-integration/git-integration-authentication-tokens)
{% 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.overleaf.com/integrations-and-add-ons/git-integration-and-github-synchronization/git-integration.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.
