Robin Keskisarkka
Robin Keskisarkka

Reputation: 896

Overleaf does not in synch with git

I'm experiencing some issues with Overleaf and Git. After pushing changes via git, the changes are not correctly reflected in the online interface. Specifically, I renamed a few folders and pushed the changes but, rather than showing the updated names, the web interface now shows both the old directory names and the new ones as separate directories. Additionally, the contents of the directories are spread out between the directories with new and old names. When I synch the project with GitHub or clone it from Overleaf, all looks as it should.

There is a related issue here, but the symptoms described are now the same as mine.

My guess is that it is an issue with how overleaf cashes the project structure. However, I can't see any way of triggering a refresh/reload/clear cache of the project structure (I tried deleting logs and compiling from scratch, as well as other browsers, to no avail).

Does anyone have any idea of what's going on here or what I can do to resolve it?

Upvotes: 1

Views: 605

Answers (1)

Robin Keskisarkka
Robin Keskisarkka

Reputation: 896

I solved my problem and realised that this was not the fault of Overleaf synchronisation, but instead related to the difference in how Overleaf and Git treat empty directories. An empty directory in Git will not not be tracked (only files are tracked); however, adding an empty folder in Overleaf is fine and will be reflected in the Overleaf project structure. Overleaf adds no placeholder (e.g. .gitkeep) file that ensures that the directory is tracked in Git.

Let's say we have created the following project structure in Overleaf:

.
|____main.tex
|____ch
| |____01
| | |____emptydir
| | |____background.tex

Now, let's say we rename ch/ to chapter/ using Git. The updated structure in Overleaf will be:

.
|____main.tex
|____ch
| |____01
| | |____emptydir
|____chapters
| |____01
| | |____background.tex

So, be aware that if you are creating empty directories in Overleaf (e.g. when setting up your project structure) these will only be visible in Git if you add placeholder files.

Upvotes: 1

Related Questions