August 5, 2010

Managing files for GAE with Git and Dropbox

At last, I started to use git to manage files that are hosting on GAE. For backup and remote access, I use Dropbox for the git repository. Here is the memo.

Resources

Steps

Actually what I did is just setting up Git in Dropbox directory. By default, GAE ignores unix hidden files whose names begin with dot from the deployment. I don’t need to care about files in the directory where GAE local server is referring to.

  1. Download Dropbox and launch it. (Create account if you don’t have the one.)
  2. Install Git. If you use Mac, you can install it with MacPorts
    $ sudo port install git-core
    
  3. Create a bare repository in Dropbox directory
    $ cd ~/Dropbox
    $ mkdir repo
    $ cd repo
    $ mkdir project_name.git
    $ cd project_name.git
    $ git --bare init
    
  4. Go to the directory that contains source files, and then push the files to the git repository
    $ cd ~/project_name
    $ git init
    $ git add .
    $ git commit -m "initial commit"
    $ git push ~/Dropbox/repo/project_name.git master
    $ git remote add origin ~/Dropbox/repo/project_name.git