https://medium.com/@jamomani/work-on-overleaf-projects-offline-420fc16ca31b
git config --global credential.helper store
then do git pull, and it will store your credential
#!/bin/bash
FILE=main.tex
pdflatex $FILE
bibtex $FILE
pdflatex $FILE
pdflatex $FILE
I'm using this https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop