Skip to content

Instantly share code, notes, and snippets.

@nbrew
Created March 16, 2011 18:20
Show Gist options
  • Save nbrew/872995 to your computer and use it in GitHub Desktop.
Save nbrew/872995 to your computer and use it in GitHub Desktop.
Create a new directory, init a git svn repository.
#!/bin/bash
if [ $# -ne 1 ]; then
script=`basename $0`
echo "usage: ./${script} repository_name"
echo "Creates a new directory and initializes a new git svn repository."
exit 1
fi
repo=$1
dir=`basename ${repo}`
mkdir ${dir} && cd ${dir} && git svn init -s ${repo} && git svn fetch && if [ -e config/database.example.yml ]; then cp config/database.example.yml config/database.yml; fi && mate . && mate config/database.yml
echo ""
echo "====================================="
echo "After editing your database.yml, run any required setup commands such as `bundle install`."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment