Skip to content

Instantly share code, notes, and snippets.

@chriswarren
Created March 21, 2009 17:49
Show Gist options
  • Select an option

  • Save chriswarren/82918 to your computer and use it in GitHub Desktop.

Select an option

Save chriswarren/82918 to your computer and use it in GitHub Desktop.
# Change this to your_account@your_domain
dreamgit_domain = '[email protected]'
# Create git repo on Dreamhost
app_name = run("pwd").split("/").last.strip
run "ssh #{dreamgit_domain} 'mkdir -p ~/git/#{app_name}.git && cd ~/git/#{app_name}.git && git --bare init'"
git :init
run "git remote add origin ssh://#{dreamgit_domain}/~/git/#{app_name}.git"
# Remove default files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
# Update .git-ignore
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore}
file '.gitignore', <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
# Add to Git Repo
git :add => "."
git :commit => "-a -m 'Initial commit'"
git :push => "origin master"
# Based on http://casperfabricius.com/site/2008/09/21/keeping-git-repositories-on-dreamhost-using-ssh/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment