-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgit.rb
35 lines (30 loc) · 883 Bytes
/
git.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Ignore auto-generated files
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', <<-CODE
log/*.log
log/*.pid
tmp/**/*
.DS_Store
mkmf.log
config/database.yml
config/mailer.yml
config/mongrel_cluster.yml
public/stylesheets/compiled/*
public/system/*
public/.htaccess
app/stylesheets/.sass-cache
db/schema.rb
*~
CODE
# Prepare for distributed development
run "cp config/database.yml config/database.yml.example"
# Initialize submodules
git :submodule => "init"
# Connect remote origin
git :remote => "add origin #{GIT_ORIGIN}",
:config => "--add branch.master.remote origin",
:config => "--add branch.master.merge refs/heads/master"
# Commit all work so far to the repository
git :add => '.'
git :commit => "-m 'Initial commit'"