The git repo for an Overleaf project is located at https://git.overleaf.com/x where x is https://www.overleaf.com/project/x.
To get the repo on the local machine:
- Navigate to the
dirthat you want to place the repo in. - Think of a name for the repo on the local machine:
y - Enter the command:
git clone -o overleaf https://git.overleaf.com/x y
To pull from overleaf to local machine
- Enter the command:
git pull overleaf
To backup the repo on bitbucket with owner username
- Navigate to
https://bitbucket.org/username/workspace/create/repository - Name the repo
y, fill out the rest of the form, and create repo. - Navigate to
dir/yon your local machine. - Enter the command:
git remote add bitbucket git@bitbucket.org:username/y.git - Enter the command:
git push bitbucket --force
To make pushing to both remote repos easier from local machine
- Navigate to
dir/yon your local machine. - Enter the command:
git remote add all https://git.overleaf.com/x - Enter the command:
git remote set-url --add --push all https://git.overleaf.com/x - Enter the command:
git remote set-url --add --push all git@bitbucket.org:username/y.git
To push to overleaf and bitbucket from local machine
- Enter the command:
git push all