You can configure your Overleaf project to sync directly with a repository on GitHub, or you can use raw git access as described below.
To sync your project directly with GitHub, open your project, go to the Menu in the top left, and choose GitHub from the Sync section. Then follow the prompts.
There are two main ways to use Overleaf with a project on GitHub, GitLab or BitBucket using our raw git access feature: add your Overleaf project as a remote, or add it as a submodule. The instructions below reference GitHub, but the process is the same GitLab, BitBucket or other hosted git providers.
If you have an repo on GitHub that you would like to create as a project on Overleaf, you can push it to Overleaf as a new project via git.
Each project on Overleaf gets its own git repo, but if you want to organise several such projects into one git repo on GitHub, you can add the repo for each project as a git submodule in the usual way. You can then push and pull each submodule repository to/from Overleaf individually and still have them collected together as submodules in the project on GitHub.
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.