Tuesday, May 05, 2009

git archive the current directory into a zip file

#/bin/sh
# git-zip.sh
#
# Creates a zip file of the HEAD of the current git repository
CWD=`basename $PWD`
git archive --format=zip --prefix=${CWD}/ -9 HEAD > ../${CWD}.zip
view raw git-zip.sh hosted with ❤ by GitHub

Labels:

Friday, May 01, 2009

Rails DB Migration on production

rake db:migrate RAILS_ENV="production"
That command will run all the Migrations it finds under db/migrate until it's at the highest version number. You can override the version number by appending VERSION=x after the command. - i.e., pass RAILS_ENV="test to force the migration to run on the test.