Using Dropbox as a Git repository
So last month I wrote a bit about setting up your own personal Git repositories on a Linux box, and how to use that for sharing code.
I’ve had a slight epiphany since then: what if I just used the awesome Dropbox (my referral link, if you’re likely to sign up) to share Git repositories between computers? Dropbox seems able to get through most corporate firewalls (my previous employer blocked SSH, for example), and is very unobtrusive in its synchronisation behaviour.
Enough introductions, make with the commands
Okay, here we go. Basically, we’re just going add a new remote which points at Dropbox (in the same way the origin remote typically points at your primary external repository). Please note these instructions should be mostly *Nix agnostic—but they’re only tested on OS X.
First, create the Git repository in Dropbox (assuming your repository is named myrepo):
cd ~/Dropbox mkdir -p repos/myrepo.git cd !$ git --bare init
And that’s the repository created. Basically we made a bare repository in the Dropbox directory.
Now we can add the new remote to our existing repository (again, assuming it lives at ~/Projects/myrepo).
cd ~/Projects/myrepo git remote add dropbox file://$HOME/Dropbox/repos/myrepo.git git push dropbox master
And we’re done. We’ve created the repository, linked a Git remote to it, and pushed the master branch to the repository. This Git repository will now be available on all computers that your Dropbox account is.
Pulling from the repository
When you get to a computer that shares this Dropbox account, but hasn’t checked out Git yet, do as follows:
cd ~/Projects git clone -o dropbox file://$HOME/Dropbox/repos/myrepo.git
Which will add your repository locally, and automatically set up a remote called dropbox which auto–merges with master.
I think this approach could be valuable for things like keeping personal documents or text files in version control (or indeed personal coding projects) without bothering to set up your own Linux box or server. Git really does make these things incredibly easy.
Post Notes
-
mike2duo reblogged this from intranation
-
phirephoenix likes this
-
mrtoto likes this
-
graphiste-moins-cher likes this
-
graphiste-pas-cher likes this
-
beat-making-software-1 likes this
-
natural-dog-food-1 likes this
-
supraveghere--video likes this
-
cartouches-imprimante likes this
-
recharge-imprimante likes this
-
parfums-pour-femmes likes this
-
parfums-moins-cher likes this
-
sos-serrurier likes this
-
serrurier-sur-paris likes this
-
appliances-repair-san-francisco likes this
-
appliance-repair-1 likes this
-
camere-de-supraveghere likes this
-
camere-supraveghere likes this
-
mulheres-gostosas-bundas likes this
-
videos-muito-engracados likes this
-
mulheres-gostosas-de-biquini likes this
-
bundas--lindas likes this
-
chrisyeem likes this
-
chrisyeem reblogged this from intranation
-
job-application likes this
-
search-engine-experts likes this
-
seo-agency-australia likes this
-
seo-trends-2013 likes this
-
sydney-marketing-agency likes this
-
web-developments-australia likes this
-
australian-hotel-suppliers likes this
-
restaurant-products-australia likes this
-
bulk-hotel-products likes this
-
wholesale-restaurant-supplies likes this
-
punk-apparel likes this
-
goth--clothing likes this
-
pasfoto-maken-groningen likes this
-
pasfoto-groningen likes this
-
cialis-1 likes this
-
viagra-1 likes this
-
home-loan-1 likes this
-
boxer-puppies likes this
-
mortgage-1 likes this
-
nuketwoski likes this
-
booster-trafic-site-com likes this
-
hairstore likes this
-
agence-web-2 likes this
-
freez-1 likes this
- Show more notes