Created
March 21, 2009 17:49
-
-
Save chriswarren/82918 to your computer and use it in GitHub Desktop.
Now in a repo at http://github.com/chriswarren/app-templates/tree/master
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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