Monday, September 26, 2011

Using git + dropbox + eclipse on windows

Some time ago I suffered a hardware crash, and even more recently I thought I lost my computer. Two incidents that both kept me up all night thinking of what content I might have lost and what impact they may have.

Realizing I have some android-projects (like TravAlertLite and Premium) using git for version control, but only using local repo i.e. no back-up what so ever. I promise myself to make some backups the very next day or even better - use a remote repository to push to. But I don't have  a server.. Hey - why not use dropbox?
(signup using my referal invite and we both get 250MB bonus space)

So - let's get to the point..

  • you are using windows
  • you are using eclipse with egit
  • you have local repo of existing project
  • you have dropbox account (default install ~/Dropbox)

  1. Open dropbox folder and create suitable directory, say 'git/private_projects/'
  2. Open the bash in your local repo and
    $ git clone --bare . ~/Dropbox/git/private_projects/my_project.git
  3. Add this new clone as remote called 'dropbox'
    $ git remote add dropbox ~/Dropbox/git/private_projecs/my_project.git
  4. Open eclipse and you are now able to push from menu team>remote

I have not fully tested this setup but it seem to work just fine for simple personal use, this is not a preferred professional setup.
I think it would work just fine among smaller teams where simultaneous pushes are less likely and also easily avoided.

I do not guarantee that this works nor do I take responsibility for consequences. I'm just sharing my thoughts and experimental experiences.

1 comment: