Showing first {{hits.length}} results of {{hits_total}} for {{searchQueryText}}{{hits.length}} results for {{searchQueryText}}

No Search Results

Note: GitHub sync and direct git are only available with paid plans on Overleaf v2. The git integration in Overleaf v1 was a free feature during its long beta period, and we will continue to offer it for free to all users with Overleaf v1 accounts. For users who signed up after Overleaf v2 was out of beta, GitHub sync and direct are only available on our paid plans, like on ShareLaTeX. As with many other v2 features, this means that the owner of the project will need a paid subscription in order to connect their project with GitHub or enable direct git access, but their collaborators can use the integration with free accounts.

Note: if you do not have a local repo on your machine yet, and wish to clone an Overleaf project down to your local machine as a new repo, please see this blog post for details.

If you have an existing repository, you can add Overleaf as a remote, just like you would for GitHub or BitBucket. There are a few commands below that you'll need to run to get things started.

To start with, we assume that you have git repo on your computer. (It might also be hosted on github or bitbucket, etc., but you need to have it cloned locally, too).

  1. Create a new project on Overleaf. You can do this from your My Projects dashboard. You might as well use the 'Blank' template, since we're going to overwrite it.
  2. Find the git link for the project.

    On Overleaf v2 you can find it by clicking on the Overleaf menu icon above the file list panel, and then on Git:


  3. Add the git link for the project as a remote in your local project.
    $ cd my-paper
    $ git remote add overleaf

    (Be sure to use your own link, not the example link.)

  4. Pull the latest content from the Overleaf project and merge it into your master branch.

    If using git 2.9 or later, use the commands:

    $ git checkout master
    $ git pull overleaf master --allow-unrelated-histories

    In earlier versions of git:

    $ git checkout master
    $ git pull overleaf master

    This will create a merge commit that pulls the blank project from Overleaf into your project.

  5. Revert the merge to get rid of the files in the existing Overleaf project.
    $ git revert --mainline 1 HEAD
  6. Push your project to Overleaf.
    $ git push overleaf master
  7. Visit the project on Overleaf. Your changes will be there. (You may have to open the Project panel to find the new main file.)

At present the online edits aren't saved in the git logs every time you make an edit online. The git bridge works this way: when we get a pull or fetch request, the git bridge copies the latest content from Overleaf to a git repo maintained by the git bridge, and then we commit it. In other words, a git commit is generated whenever a user git-pulls or fetches from the project. If you save a version via the History and Revisions menu, and then you do a git pull, the saved version will become a commit in the repository’s git history.

Migrating from Overleaf v1

On Overleaf v2, the git remote format has changed, compared to Overleaf v1. You can find the new git remote for your project by opening the project, going to the Menu in the top left, and choosing Git from the Sync section. You will need to move projects from Overleaf v1 to Overleaf v2 and update their git remotes and/or submodules in order to keep working on them.

Overleaf v2 also requires you to log in using your Overleaf email address and password, whereas v1 did not. Editing projects on Overleaf v2 now requires you to log in first.

Known Limitations

  • Branches: The overleaf git system does not support branching.
  • Symlinks: The git system does not handle Symlinks well. A symlink can be pushed into an Overleaf project, but will be converted to a regular file, and will over-write the local symlink the next time the project is pulled.
  • Renaming Folders: If a user renames a folder, and pushes the change to Overleaf, the project will retain an empty folder with the old name, in addition to the new folder. (For example, renaming images/ to img/ will leave two folders in the project: img/ containing the image files, and images/, which will be empty.This can cause problems when a user renames a folder, and creates a new file with the same name as the old folder, in one commit. The git system will reject this commits. In this case we recommend splitting the commit up into two parts, and deleting remaining folder manually from the Overleaf web interface, before pushing the commit containing the new file.


Thanks to Tim Korb at Purdue for suggesting this approach.

Thanks to Nicolas Poggi at BarcelonaTech for alerting us to the git 2.9+ issue and its fix.

Overleaf guides

LaTeX Basics


Figures and tables

References and Citations


Document structure





Field specific

Class files

Advanced TeX/LaTeX