Skip to content

LaTeX: Overleaf GIT TexStudio integration

Francesco W edited this page Jul 28, 2017 · 9 revisions

This tutorial will guide through the process of having TexStudio able to push commits to the repository created by the Overleaf, the online LaTeX editor, having so the possibility of using an offline TeX editor and fully syncing your work.

Prerequisites

You will need git installed on your system (to be able to use the git command) and TexStudio.

Instructions

Overleaf lets you git clone your projects using the "Share" button. Once you've cloned your repository you can commit and push from it and it will update your Overleaf project! To work locally and easily use git, you can configure TexStudio to make git commits using a dedicated button by following these steps:

  1. Add a .gitignore in your repository like this one (in Windows when you create the file you have to name it .gitignore. to be able to save it):
*.bat
*.gz
*.aux
*.log
*.bbl
*.blg
*.lot
*.tcp
*.toc
*.lof
  1. Add a gitcommit.bat file like this one:
git add .
git commit -am "Autosave %date%-%time:~0,8%"
git push
  1. In TexStudio, under the preferences ("Configure TexStudio", check the Advanced Mode box), in the Build menu add a new user command as in the picture: git commit command

  2. Then in the Toolbars menu, from the right dropdown list go to Tools-->User and select the gitcommit command. Then from the left dropdown list choose a menu where you'd like to put your command button and click the blue move arrow in the middle to add it. You can even assingn an icon like the one below.

git icon