- start a blank overleaf project
- go to the share menu and copy git link from "Clone with git" (e.g.
https://git.overleaf.com/blahblahblaah)
set up overleaf as a remote
git remote add overleaf https://git.overleaf.com/blahblahblaah
git checkout -b collaboration overleaf/masterlet's say you want to work on blah.tex. just check it out from your local branch.
(you can repeat this for any other files, like library.bib you also want to add)
git checkout master -- blah.tex #
git commit -m "Add blah.tex"finally, update overleaf. need to use this method for any push to overleaf (because local and remote branch names don't match)
git push overleaf collaborate:masterdo some editing
git checkout collaboration
git pull overleaf masterthen integrate the new changes to your master branch
git checkout -b integrate collaboration
git rebase -i master
# squash the commits and write an explanatory message
git checkout master
git merge integrate
git branch -d integrateOverleaf is designed for tex, but it's also an ok real-time plaintext editor. You can do the above with .md or even .Rmd files. (But preview won't work, and you should set it to manual to avoid endless compilation)