Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to host a bare Git repository using Dropbox, to share code?

Tags:

I realize that there are similar questions, but my question is slightly different: I'm wondering whether sharing a bare repository via a synchronized Dropbox folder on multiple computers would work for sharing code via Git?

In other words: is sharing a Git repo via Dropbox the same as sharing it from one centralized location, for example, via SSH or HTTP?

Does the repo get updated on each person's local drive? Is this the same as sharing a Git repo via a shared network drive?

Note: This is not an empirical question: it seems to work fine. I'm asking whether the way a Git repo is structured is compatible with this way of sharing.

EDIT To clarify/repeat, I'm talking about keeping the Git repository on Dropbox as a bare repository. I'm not talking about keeping the actual files that are under source control in Dropbox.

like image 561
Dan Rosenstark Avatar asked Feb 04 '10 12:02

Dan Rosenstark


People also ask

Can you use git with Dropbox?

git-remote-dropbox. git-remote-dropbox is a transparent bidirectional bridge between Git and Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote! This Git remote helper makes Dropbox act like a true Git remote.

Can I use GitHub like Dropbox?

Every call within Git Bash causes an interaction with that folder and your local files and that's how version control is maintained. GitHub is just Dropbox for Git. You're backing up your repository online with the added ability to share with other people. That's it.


1 Answers

I see no reason why it would lose data -- Git's repository structure is robust, and in the repository store itself, files with the same name will always have the same content (this doesn't apply to branch names).

It's not going to be efficient, though. Git's transfer protocol means that it will usually only transfer a change once. With Dropbox, if two people pack slightly different repositories, the packs generated may contain significant common data while not being identical, so DropBox would sync both packs, which is inefficient.

You may also find that, although the data is all there, you wind up with un-tracked changes due to two copies both having the same branch updated at the same time. This can be worked around by ensuring that you push to different branches from each copy, but it'd be a pain.

like image 158
Andrew Aylett Avatar answered Oct 01 '22 14:10

Andrew Aylett