• Stars
    star
    3,041
  • Rank 14,717 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A transparent bridge between Git and Dropbox - use a Dropbox (shared) folder as a Git remote! ๐ŸŽ

git-remote-dropbox Build Status pypi

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. It maintains all guarantees that are provided by a traditional Git remote while using Dropbox as a backing store. This means that it works correctly even when there are multiple people operating on the repository at once, making it possible to use a Dropbox shared folder as a Git remote for collaboration.

Once the helper is installed, using it is as simple as adding a remote like dropbox:///path/to/repo.

To clone repositories in folders or shared folders mounted in your Dropbox, you can run:

git clone "dropbox:///path/to/repo"

To add a remote to an existing local repository, you can run:

git remote add origin "dropbox:///path/to/repo"

The repository directory will be created automatically the first time you push.

After adding the remote, you can treat it just like a regular Git remote. The Dropbox-backed remote supports all operations that regular remotes support, and it provides identical guarantees in terms of atomicity even when there are concurrent operations, even when using a shared folder.

Setup

Install git-remote-dropbox

  1. Prerequisites:
    1. python and matching pip
    2. git
  2. Install this package with pip install git-remote-dropbox. Use which git-remote-dropbox to make sure it's available via $PATH. If not, edit $PATH appropriately.

Log in to Dropbox

Run git dropbox login and follow the instructions to authenticate with OAuth and log in to your Dropbox account.

Sharing

The above gives you a way to create a Git repository on Dropbox and use it from multiple machines that you own. In other words, it's a convenient way to share a remote with your laptop and your desktop.

If you want to share with other people, you should explicitly share (e.g. via the Dropbox website) the root folder of the repo with your collaborators. Then they should also install git-remote-dropbox and log in with their own account.

Multiple Accounts

git-remote-dropbox supports using multiple Dropbox accounts. You can have named accounts with git dropbox login <username>. These usernames are unrelated to your Dropbox login; you can choose whatever names you want to organize your accounts, e.g. "work".

You can tell git-remote-dropbox to use a particular account by setting the git remote URL appropriately, specifying a username like: dropbox://username@/path/to/repo.

Repository Manager

In addition to the git remote helper, git-remote-dropbox comes with an additional tool to manage your logins and repositories on Dropbox. This tool can be invoked as git dropbox.

The tool supports the following commands:

  • git dropbox login [username]: log in, either with the default account (no need to specify a username in remote), or with an alias (for multi-account support)
  • git dropbox logout [username]: log out
  • git dropbox show-logins: list logged-in accounts
  • git dropbox set-head <remote> <branch>: set default branch on the remote
  • git dropbox version: show version

Notes

  • Do not directly interact with Git repositories in your Dropbox folder -always use git-remote-dropbox. If you're using the Dropbox client to sync files, it's a good idea to use selective sync and disable syncing of the folder containing the repository to avoid any unexpected conflicts, just in case.

  • git-remote-dropbox does not use the Dropbox desktop client - it uses the API directly. It does not require that the desktop client is installed.

  • The remote helper does not support shallow cloning.

  • Cloning a repository or fetching a lot of objects produces lots of loose objects. To save space in the local repository, run git gc --aggressive.

  • If the remote HEAD (default branch on the remote) is not set, after cloning a repository from Dropbox, Git will not automatically check out a branch. To check out a branch, run git checkout <branch>. To set the default branch on the remote, use the git dropbox command.

FAQ

Why shouldn't I keep my Git repository in Dropbox and let the client sync it?

There seem to be a lot of articles on the Internet recommending this as a good workflow. However, this is not a good idea! The desktop client is not aware of how Git manages it's on-disk format, so if there are concurrent changes or delays in syncing, it's possible to have conflicts that result in a corrupted Git repository. This may be uncommon with the way the timing works out in the single user case, but it's still not safe!

Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it as a folder-based Git remote, and sync it with the desktop client?

There seem to be some articles on the Internet suggesting that this is a good idea. It's not. Using the desktop client to sync a bare Git repository is not safe. Concurrent changes or delays in syncing can result in a corrupted Git repository.

How can I access / recover my repository from Dropbox without using the git-remote-dropbox helper?

Because git-remote-dropbox uses an on-disk format that's compatible with Git, accessing your repository without using the helper is easy:

  1. Download the repository data (a directory containing the objects and refs directories) from Dropbox.
  2. Make a new directory and initialize an empty Git repository in the directory.
  3. Overwrite .git/refs and .git/objects in your newly initialized repository with the data downloaded from Dropbox (using a command like rm -rf .git/{refs,objects} && cp -r /path/to/data/{refs,objects} .git/).
  4. Check out a branch (using a command like git checkout -f master).
  5. Optionally, run git gc --aggressive to save disk space in your local repository.

How do I use git-remote-dropbox from behind a proxy server?

You can use git-remote-dropbox from behind a proxy server by setting the HTTP_PROXY and HTTPS_PROXY environment variables. See here for more details.

How do I use git-remote-dropbox with submodules?

You can allow this by setting protocol.dropbox.allow to always:

git config --global --add protocol.dropbox.allow always

Design

To read about the design of git-remote-dropbox, see DESIGN.md. This could be especially useful if you're thinking about contributing to the project.

Contributing

Do you have ideas on how to improve git-remote-dropbox? Have a feature request, bug report, or patch? Great! See CONTRIBUTING.md for information on what you can do about that.

License

Copyright (c) Anish Athalye. Released under the MIT License. See LICENSE.md for details.

More Repositories

1

dotbot

A tool that bootstraps your dotfiles โšก๏ธ
Python
6,896
star
2

neural-style

Neural style in TensorFlow! ๐ŸŽจ
Python
5,542
star
3

lumen

Magic auto brightness based on screen contents ๐Ÿ’ก
Objective-C
2,284
star
4

gemini

Gemini is a modern LaTex beamerposter theme ๐Ÿ–ผ
TeX
946
star
5

obfuscated-gradients

Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples
Jupyter Notebook
876
star
6

porcupine

A fast linearizability checker written in Go ๐Ÿ”Ž
Go
856
star
7

seashells

The official client for seashells.io ๐Ÿš
Python
706
star
8

dotfiles

~anish โ€ข powered by https://github.com/anishathalye/dotbot ๐Ÿ’พ
Shell
691
star
9

neural-hash-collider

Preimage attack against NeuralHash ๐Ÿ’ฃ
Python
663
star
10

gavel

A project expo judging system ๐Ÿ“Š
Python
430
star
11

periscope

Periscope gives you "duplicate vision" to help you organize and de-duplicate your files without losing data ๐Ÿ”ญ
Go
372
star
12

auriga

Auriga is a minimalist LaTeX beamer presentation theme ๐Ÿ“ฝ
TeX
322
star
13

offix

"Who is in the office?" ๐Ÿ‘€
JavaScript
181
star
14

dotfiles_template

A template for structuring dotfiles (using Dotbot as an installer) ๐Ÿ“œ
PowerShell
181
star
15

ribosome

Synthesize photos from PhotoDNA using machine learning ๐ŸŒฑ
Python
141
star
16

imagenet-simple-labels

Simpler human-readable labels for ImageNet ๐Ÿท
117
star
17

dotfiles-local

~anish [local config] โ€ขย powered by https://github.com/anishathalye/dotbot ๐Ÿ 
Shell
74
star
18

mathematics-of-deep-learning

The Mathematics of Deep Learning, SIPB IAP 2018
Jupyter Notebook
74
star
19

proof-html

A GitHub Action to validate HTML, check links, and more โœ…
Ruby
53
star
20

seashells-server

The seashells.io server ๐Ÿš
Go
52
star
21

knox

A framework for formally verifying hardware security modules to be free of hardware, software, and timing side-channel vulnerabilities ๐Ÿ”
Racket
29
star
22

notary

Notary: A Device for Secure Transaction Approval ๐Ÿ“Ÿ
Verilog
28
star
23

hubot-group

A hubot script that expands mentions of groups ๐Ÿ‘ซ
CoffeeScript
26
star
24

synox

Rust library for program synthesis of string transformations from input-output examples ๐Ÿ”ฎ
Rust
24
star
25

disposable

Create a Reddit throwaway account with the click of a button! ๐Ÿšฎ
JavaScript
23
star
26

knox-hsm

Circuits and hardware security modules formally verified with Knox ๐Ÿ”
Verilog
22
star
27

skipchat

SkipChat - MHacks V
C
20
star
28

rtlv

Tools for reasoning about circuits in Rosette/Racket ๐Ÿ”Œ
Racket
18
star
29

micro-wwvb

A tiny WWVB station ๐Ÿ“ก
C
17
star
30

linux-bootstrap

get a debian-based system set up the way I like it, with minimal effort on my part
17
star
31

hubot-shortcut

A macro system for hubot ๐Ÿ’จ
JavaScript
16
star
32

bin2coe

A tool to convert binary files to COE files ๐Ÿ’ซ
Python
14
star
33

hubot-conf

A simple configuration management system for hubot ๐Ÿ”ง
JavaScript
11
star
34

anishathalye

A self-updating GitHub profile ๐Ÿฏ
Python
11
star
35

gitlive

the source code that powered gitlive.net
Java
11
star
36

chroniton

A tool for formally verifying constant-time software against hardware ๐Ÿ•ฐ๏ธ
Racket
9
star
37

unblock

A tiny utility to make shell pipes behave as if they have unlimited buffering โ™พ
Go
7
star
38

countdown

A simple countdown timer you can set as your homepage โฐ
HTML
5
star
39

coqioa

A formalization of IO automata in the Coq proof assistant
Coq
5
star
40

x

playground for testing stuff on github
4
star
41

assets

README assets for my GitHub projects ๐ŸŽญ
4
star
42

easy-security

Slides from the SIPB Cluedump on Low Effort High Impact Security
HTML
3
star
43

learn-pgp

Slides from the SIPB Cluedump on PGP
HTML
3
star
44

learn-git

An introduction to using Git - prepared for HackMIT / Hack Week 2015
HTML
2
star
45

deterministic-start-benchmark

Verilog
2
star
46

ipr

A formalization of information-preserving refinement (IPR) in the Coq Proof Assistant ๐Ÿงฉ
Coq
2
star
47

xclips

Rust
1
star
48

scripts

Python
1
star
49

formal-methods-tutorial-2022-10-11

Racket
1
star