It is possible to use Dropbox as a "remote" repository. It is not perfect, updating or pushing to the remote from two location simultaniously will surely corrupt the repository. That being said it is a practical trick for syncing repositories between computers without both having write access to "origin" (i.e. github, gitlab or the like).
I store the repositories in a directory "git" in my dropbox folder. Create it if it does not yet exist, or make up you own
name:
mkdir ~/Dropbox/git/
- Change to the repository for which you want to create a remote
cd /path/of/your/repository
- Initialise the git repository in the Dropbox shared folder
git init --bare ~/Dropbox/git/repository-name.git
- Add the new repository as a remote
git remote add Dropbox ~/Dropbox/git/repository-name.git
- Push all branches to the new remote
git push Dropbox --all
Now on another computer wait until Dropbox has finished syncing, then add Dropbox as a remote again (see step 3). You can then fetch and pull from Dropbox and push to origin. Yay!