Disclosure up front: I make ModernTex, which is one of the options at the end. The Git steps work with any editor. I ran the Git commands below on a Mac with Apple's Git 2.50.1 against a local test repository, not against a live Overleaf project, so the parts that depend on Overleaf come from Overleaf's Git documentation, read October 15, 2026.
What you need first
- A project whose owner has a paid Overleaf plan. The documentation calls Git integration a premium feature, available when the project's owner has a paid subscription or has been given access. Many universities have a site licence that includes it. On a free account, use the zip download instead (see the end of this page).
- Git on your Mac. Run
git --versionin Terminal. If it is missing, macOS offers to install the command line tools. - A TeX distribution to build locally, MacTeX or TinyTeX. The install guide compares them.
Step 1: get the Git address and a token
In Overleaf, open the project, choose Menu, then Git. Copy the address. On Overleaf's cloud service it has this form, where the last part is your project's id:
https://git.overleaf.com/1234567
Overleaf does not accept your account password for this. Create a Git authentication token in your Overleaf account settings; the first time you use Git you can also generate one from the project's Git menu. Copy the token when it is shown, because you cannot view the whole token again. Per the documentation you can hold up to 10 tokens, and each expires after one year.
Step 2: clone the project
cd ~/Documents
git clone https://git.overleaf.com/1234567 my-paper
Git asks for a username and a password. The documentation says to enter git as the username and the token as the password. Apple's Git on a Mac is set up to use the macOS Keychain helper (osxkeychain; I confirmed this in the Git configuration on the Mac I used), so it should remember the token after the first time.
Check the branch name:
cd my-paper
git branch --show-current
New clones use main. Older ones may use master. Overleaf does not support branches, so stay on that one.
Step 3: build it locally
The project folder now has your .tex, .bib and image files. Build it with the main file's name:
latexmk -pdf -synctex=1 main.tex
Use -xelatex or -lualatex in place of -pdf if the project used XeLaTeX or LuaLaTeX in Overleaf. The compiler and main document are settings in Overleaf's menu, not files in the repository, so check them there. The rest of the matching settings (Biber, shell escape, fonts) are the same as when you move a project by zip; they are listed in the move checklist. For jumping between source and PDF, see SyncTeX on Mac.
Step 4: keep build files out of the project
If you commit everything, you will push .aux and .log files into the Overleaf project. A .gitignore would itself become a file in the project, so use the repository's private exclude file instead. Name your own main PDF rather than ignoring every PDF, because your figures may be PDFs:
printf '%s\n' '*.aux' '*.log' '*.bbl' '*.blg' '*.out' '*.fls' '*.fdb_latexmk' '*.synctex.gz' 'main.pdf' >> .git/info/exclude
Files Overleaf already tracks are not affected by this.
Step 5: the working cycle
Pull before you start, work, then commit and push when you stop:
git pull --no-rebase
# edit and build
git add -A
git commit -m "Revise methods section"
git push
The --no-rebase matters. I tested what happens when the remote has a commit you do not have. A git push is rejected with a hint to pull first, and a plain git pull on this Git version stops with "Need to specify how to reconcile divergent branches". git pull --no-rebase merges the two sides, which is the simplest choice for a paper. You can set it once for this project with git config pull.rebase false.
If you and a co-author changed the same lines, Git stops the merge and marks the file with <<<<<<<, ======= and >>>>>>> lines. Edit the file to keep what you want, remove the markers, then git add it and git commit. Short sessions and frequent pushes keep this rare. To show a co-author what you changed, a latexdiff PDF marks the edits.
What to watch for
These points are from Overleaf's documentation, not from my testing:
- Track changes and comments. A push from Git can move or lose them. Overleaf advises against mixing active Git use with track changes or comments.
- Renames. A rename or move in Git becomes a delete and a create in Overleaf, which can remove that file's tracked changes and comments.
- Large or unusual commits. Pushes can fail for projects over the plan's file size or file count limits, and for symlinks or Git LFS files. Large commits can time out, so split them.
- A pull creates a commit. Overleaf creates a commit for the project's current state when you pull or fetch, if one does not already exist.
Doing this in ModernTex
ModernTex has an Overleaf panel for this, opened with Command-Shift-E. It asks for three things: the Git URL from Step 1, a field labelled Email / Username, and a field labelled Password / Token. Following Overleaf's documentation, enter git and the token. Push stages all local changes and uploads them to Overleaf. Pull downloads the latest version, and local changes are committed first so they are not lost. The panel is labelled as an Overleaf Premium feature, matching the plan requirement above. I have not run it against a live Overleaf project for this guide.
The panel also imports and exports a zip, which works on every plan. For two Macs, or a co-author who uses GitHub or GitLab, Get Changes (Command-Option-G) and Send Changes (Command-Control-S) work with a plain Git remote. Changes Since Last Sync (Command-Option-D) builds a PDF with your edits marked, using latexdiff, which the app can install. It marks the text of .tex files only. The ModernTex page describes the co-author setup.
If you are on the free plan
Download the source from Overleaf (Menu, Download, Source), work locally, and upload the changed files back, replacing the old versions. It is easy to overwrite a co-author's edit this way, so tell them first. The Overleaf alternatives guide covers the move and the hybrid workflow, and the compile timeout guide covers the free plan's compile limit.