Purplelink
← All guides

Move an Overleaf project to a local Mac editor with Git

Clone the project with Overleaf's Git address and a token, build it on your Mac, and push changes back. This needs a paid Overleaf plan on the project's owner. Free accounts can use the zip route.

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

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:

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.

Frequently asked questions

Does Overleaf Git integration work on a free account?
No. Overleaf documents Git integration as a premium feature on its cloud service. It is available when the project's owner has a paid subscription or has been granted access, for example through an institutional licence. On a free account, download the source as a zip and upload changed files by hand.
What username and password do I use to clone an Overleaf project?
Per Overleaf's documentation, use git as the username and a Git authentication token as the password. Create the token in your Overleaf account settings. Your normal account password is not used.
Why does git pull say it needs to reconcile divergent branches?
The remote has a commit you do not have, and Git does not know whether to merge or rebase. Run git pull --no-rebase to merge, or set it for the project with git config pull.rebase false.
Can I use ModernTex to edit an Overleaf project?
Yes. ModernTex has an Overleaf panel (Command-Shift-E) that clones, pushes and pulls with the Git address and a token, and it can import and export a zip on any plan. The Git part needs a paid Overleaf plan.

From the maker of these tools

Writing LaTeX on a Mac?

ModernTex has an Overleaf panel that pulls and pushes a project with its Git address and token, plus a zip import for free accounts. $19.99 once, after a free trial.

I make ModernTex. $19.99 once after the trial, macOS 14 or later, no account.