2010-03-30 2 views

답변

36

이것은 다음과 매우 유사합니다. Rails: exclude anything from version control? 여기 내 답이 있습니다.

DHH는 posted on Twitter 포함 레일 3의 default .gitignore있을 것입니다 :

db/*.sqlite3 
log/*.log 
tmp/**/* 

이 내가 제외 무엇 일반적이다. 어떤 사람들은 공개 repo에서 데이터베이스 암호를 공개하지 않으려는 경우 database.yml 파일을 제외하기를 원합니다.

5

Heroku의 슬러그 컴파일러는 .slugignore이라는 파일을 사용하는 매우 유사한 기능을 가지고 있습니다. 이 파일 구문은 이고 대략.gitignore과 같습니다. (<이 20MB 좋은 소리) : (PSD 파일, 스프레드 시트 및 기타 일반적인 파일을 저장 예)하지만 슬러그의 크기를 낮출 수에게 Heroku에 런타임 에서 제거

그래서 당신은 평소와 같이 작업을 계속할 수 있습니다.

+0

. 그러나'.slugignore' 파일은 일단 업로드되면 제거 할 것입니다. 따라서 미리 큰 파일을 업로드해야합니다. – matsko

11

https://github.com/github/gitignore/blob/master/Rails.gitignore

*.rbc 
capybara-*.html 
.rspec 
/log 
/tmp 
/db/*.sqlite3 
/db/*.sqlite3-journal 
/public/system 
/coverage/ 
/spec/tmp 
**.orig 
rerun.txt 
pickle-email-*.html 

# TODO Comment out this rule if you are OK with secrets being uploaded to the repo 
config/initializers/secret_token.rb 

# Only include if you have production secrets in this file, which is no longer a Rails default 
# config/secrets.yml 

# dotenv 
# TODO Comment out this rule if environment variables can be committed 
.env 

## Environment normalization: 
/.bundle 
/vendor/bundle 

# these should all be checked in to normalize the environment: 
# Gemfile.lock, .ruby-version, .ruby-gemset 

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 
.rvmrc 

# if using bower-rails ignore default bower_components path bower.json files 
/vendor/assets/bower_components 
*.bowerrc 
bower.json 

# Ignore pow environment settings 
.powenv 

# Ignore Byebug command history file. 
.byebug_history 
+1

거기에 내가 좋아하는 프레임 워크를 볼 수있어서 기쁩니다! – jocull

0

다른 언어, 편집자 등 프로젝트가 현재 Heroku가 특정 항목이없는 상태에 대한 정확한 gitignore 파일을 저장 전용 Github에서의 프로젝트가있다, 당신 여전히 검토하는 것이 유용 할 수 있습니다. 프로젝트는 here이고 레일 .gitignore는 here입니다.

참고로이 프로젝트에 대해 알게 된 곳은 this입니다. 스택 오버플로 질문. Heroku가에

1

는 가장 좋은 시작 옵션은 다음과 같습니다 최고

db/ 
log/ 
test/ 
tmp/ 
관련 문제