Using Dropbox or Google Drive for Git repositories

mhjaafar profile image Hafiz Jaafar ・1 min read

When Git projects are considered too private to be pushed to GitHub or GitLab and you don't mind about missing the features there, then you could utilize your Dropbox or Google Drive as a Git repository.


Following is an example with Dropbox on Ubuntu-Mate:

  1. Dedicate a directory in Dropbox for Git:
you@your-pc:~$ cd Dropbox
you@your-pc:~/Dropbox$ mkdir git
  1. Initialize your repository, at best with the same name with your project:
you@your-pc:~/Dropbox$ cd git
you@your-pc:~/Dropbox/git$ git init --bare your-project.git
  1. If your project is not yet initialized as a Git project:
you@your-pc:~$ cd your-project
you@your-pc:~/your-project$ git init .
  1. Connect your project with the Git repository in Dropbox:
you@your-pc:~/your-project$ git remote add origin ~/Dropbox/git/your-project.git
  1. Commit your project for the first time and push to the repo. Start your Dropbox. You're done.
you@your-pc:~/your-project$ git add .
you@your-pc:~/your-project$ git commit -m "First commit." -m "From Dropbox."
you@your-pc:~/your-project$ git push -u origin master
you@your-pc:~/your-project$ caja-dropbox start

Posted on by:

mhjaafar profile

Hafiz Jaafar


A Java developer. Previous stints in computer vision and robotics. Then I threw away my humanity like Dio Brando did and joined financial services. Used to code in C++, Python, and C#.


markdown guide