我在本地創建了GIT repo。我現在看到一堆文件,我寧願忽略GIT登記。這引出了我的問題:Rails是否有任何默認的.gitignore?任何最佳實踐?Rails忽略GIT的文件
我想到tmp和log肯定的。但是我應該考慮其他文件或文件夾嗎?
我在本地創建了GIT repo。我現在看到一堆文件,我寧願忽略GIT登記。這引出了我的問題:Rails是否有任何默認的.gitignore?任何最佳實踐?Rails忽略GIT的文件
我想到tmp和log肯定的。但是我應該考慮其他文件或文件夾嗎?
Github提供了樣本.gitignore
幾乎所有人類已知的項目文件。
這個答案令人難以置信的真棒。 – 2013-01-15 04:19:51
我需要一個「最喜歡的答案」明星系統。 – Kheldar 2016-03-15 10:05:40
這是一個比較大的Rails 3.2的應用程序(使用Rails 3.1創建)
/.bundle
/db/*.sqlite3
/log/*.log
/tmp
config/database.yml
config/google_analytics.yml
.DS_Store
/nbproject/
public/assets/**
只是基本的gitignore附帶導軌一個gitignore並增加了一些開發商特定的東西,如Netbeans項目的東西,來自OS X的.DS_Store
並且我們不喜歡我們倉庫中的密碼,所以我們添加所有帶有密碼的yml文件到gitignore
我們還添加了公共/資產/ **,因爲我們部署我們的Capistrano的應用和部署過程中產生的資產和推動他們亞馬遜
的.git /信息/排除 如果你想基礎上,排除模式那麼您可以將它們放在名爲.git/info/exclude或core.excludes文件的特定存儲庫中的文件中。
.gitignore用於添加您不希望被跟蹤的文件。 如果該文件已被跟蹤,並且您想要添加到.gitignore。 運行git RM --cached名
。利用這個GITIGNORE.IO
### Rails ###
*.rbc
capybara-*.html
.rspec
/log
/tmp
/config/database.yml
/db/*.sqlite3
/db/*.sqlite3-journal
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
pickle-email-*.html
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/secrets.yml
## Environment normalisation:
/.bundle
/vendor/bundle
# these should all be checked in to normalise 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 enironment settings
.powenv
的Rails應該已經生成了你'.gitignore'文件最常見的非源控制文件包含已 – Gareth 2012-03-08 10:45:24