Git HTTPS Overleaf

For practical purposes, Git over HTTPS works with Overleaf if others aren’t editing the same document at the same time via the web interface. Overleaf has a single Git branch and requires a linear Git commit history (no force Git push). If other users are using the normal web interface of Overleaf to edit the same document, Git merge will be frequently needed on local Git, which may be inconvenient. Practically speaking, if coworkers on the same Overleaf LaTeX document are using Git to push local edits, and they use Overleaf just to view, it can work OK.

The Git repo URL is given from the Overleaf project, under Menu → Sync → Git. The Git URL is a long hexadecimal number. As usual with Git, clone to a human-friendly directory name like “paper1”.

git clone https://git.overleaf.com/<hash> paper1

Some Overleaf projects may be large (100s of MB) and can take minutes to download. To show progress while Git cloning in general, add the –verbose “git clone” option.

Git pre hooks

Computer-wide Git pre-commit hooks may be bothersome when uploading. To disable Git pre-commit hooks for the repo:

git config core.hooksPath " "

Git HTTPS configuration

Overleaf Git interface uses token authentication.

Git can use HTTPS credential cache mechanisms–on Windows consider Microsoft Git Credential Manager. A Git credential cache can avoid typing the password for each remote Git operation. The command below remembers the Git HTTPS password for 300 seconds (5 minutes).

git config credential.helper 'cache --timeout=300'

GPG sign

Since Overleaf Git tracking is limited, one may wish to disable GPG signing to avoid the burden of typing the additional GPG password on Git commit. As usual, this can be done on a per-Git-repo basis like:

git config commit.gpgsign false