Using Git directly with Overleaf

Overleaf users can connect with Git directly to Overleaf. 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:

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

Store Overleaf username for Git: avoid having to constantly type your username for git.overleaf.com (or any other Git HTTPS connection):

git config credential."https://git.overleaf.com".username your@email.address

Use the same email address you use to login to Overleaf. Depending on your Overleaf project settings, you may need to type the Overleaf password for git push to Overleaf.

If there is a Git credential helper, you may need to disable it for Overleaf repos by in the Overleaf repo:

git config credential.helper " "

Computer-wide Git pre-commit hooks may be bothersome when uploading. To disable Git pre-commit hooks for a single repo, from the repo directory, type:

git config core.hooksPath " "

Git can use operating-system specific HTTPS credential cache mechanisms–here are a couple for Linux vs. Windows.

For Linux, optionally set a Git credential cache to avoid typing the password for Git HTTPS push each time. The command below remembers the Git HTTPS password for 300 seconds (5 minutes).

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

The Git credential cache is for HTTPS Git credentials. SSH credential caching is configured separately with SSH, and is not affected by this Git cache setting.

For Windows consider Microsoft Git Credential Manager.