DEV Community

Hafiz Jaafar
Hafiz Jaafar

Posted on

Using Dropbox or Google Drive for Git repositories

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.

Example

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
Enter fullscreen mode Exit fullscreen mode
  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
Enter fullscreen mode Exit fullscreen mode
  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 .
Enter fullscreen mode Exit fullscreen mode
  1. Connect your project with the Git repository in Dropbox:
you@your-pc:~/your-project$ git remote add origin ~/Dropbox/git/your-project.git
Enter fullscreen mode Exit fullscreen mode
  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
Enter fullscreen mode Exit fullscreen mode

Top comments (0)