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

后端 未结 8 934
借酒劲吻你
借酒劲吻你 2020-11-27 16:56

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 folde

8条回答
  •  爱一瞬间的悲伤
    2020-11-27 17:45

    I'm pretty sure that this is unsafe. There's a bunch of moving parts in a Git repository, and Dropbox could easily wreck one of them. For example, you might end up with incorrect branch tips (master, etc.) in the refs directory, or your object store might stop working if the objects/info/packs file has the wrong contents. Git repos are fairly simple and robust, but they are not just dumb unbreakable storage.

    Accessing remote repositories through SSH, git, or HTTP, or even locally on a network file system, is safe because the repository is only accessed through a git process, which makes sure that everything is moved into place in the right order. But Dropbox doesn't make any kind of guarantees about ordering, so you might lose data.

    Just use a Git server (or any SSH server) instead -- if you don't have one, GitHub, Bitbucket or GitLab come to mind. It'll save you a lot of trouble, and it's no harder to use than a local repository shared through Dropbox (you just have SSH URLs instead of local paths).

提交回复
热议问题