github/gitignore · Ruby.gitignore

Penjelasan template .gitignore Ruby

Menjelaskan mengapa Ruby.gitignore mengabaikan paket gem, folder instalasi Bundler, hasil pengujian, dan dokumentasi hasil generate, serta kriteria commit untuk Gemfile.lock dan .ruby-version.

Buka di generator Buka bersama Rails, macOS, JetBrains

Ruby.gitignore ditujukan untuk proyek yang membuat gem atau mengembangkan skrip dan aplikasi Ruby. Sebagian besar aturannya diawali / sehingga terpaku pada root repositori, jadi jarang terjadi subfolder bernama sama ikut diabaikan tanpa sengaja.

Untuk aplikasi Rails, template Rails menangani lebih banyak kasus daripada template ini. Jika keduanya dipilih bersama, aturan yang tumpang tindih dirapikan oleh penghapusan duplikat.

Penjelasan per aturan

PolaApa yang diabaikan dan mengapa
*.gem/pkg/Paket gemFile paket yang dibuat gem build dan rake build. Ini hasil yang dipublikasikan ke RubyGems.
/.bundle//vendor/bundle/lib/bundler/man/Bundler.bundle/ berisi pengaturan Bundler lokal, dan vendor/bundle berisi gem yang dipasang dengan bundle install --path. Bisa dipasang ulang di komputer lain.
/coverage//spec/reports//spec/examples.txt/test/tmp//test/version_tmp/Hasil pengujianHasil eksekusi seperti hasil SimpleCov, laporan RSpec, dan examples.txt tempat RSpec mengingat contoh yang gagal.
/.yardoc//_yardoc//doc//rdoc/Dokumentasi hasil generateDokumentasi API dan cache yang dibuat YARD dan RDoc. Dibuat ulang dari komentar kode sumber.
/tmp/.byebug_history.repl_history*.rbc/.config/InstalledFilesFile sementara dan debuggerFolder sementara, riwayat byebug dan REPL, bytecode Rubinius, dan catatan instalasi setup.rb.
.rvmrcPengaturan pengelola versiFile pengaturan proyek lama milik RVM; karena dapat menjalankan kode shell, sebaiknya tidak dibagikan. Saat ini umumnya dipakai .ruby-version.

Hal yang perlu diperhatikan dalam praktik

Template asli

Ruby.gitignore26 baris aturan
*.gem*.rbc/.config/coverage//InstalledFiles/pkg//spec/reports//spec/examples.txt/test/tmp//test/version_tmp//tmp/# Used by dotenv library to load environment variables.# .env# Ignore Byebug command history file..byebug_history## Specific to RubyMotion:.dat*.repl_historybuild/*.bridgesupportbuild-iPhoneOS/build-iPhoneSimulator/## Specific to RubyMotion (use of CocoaPods):## We recommend against adding the Pods directory to your .gitignore. However# you should judge for yourself, the pros and cons are mentioned at:# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control## vendor/Pods/## Documentation cache and generated files:/.yardoc//_yardoc//doc//rdoc/## Environment normalization:/.bundle//vendor/bundle/lib/bundler/man/# for a library or gem, you might want to ignore these files since the code is# intended to run in multiple environments; otherwise, check them in:# Gemfile.lock# .ruby-version# .ruby-gemset# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:.rvmrc# Used by RuboCop. Remote config files pulled in from inherit_from directive.# .rubocop-https?--*

Sumber template: github/gitignore/Ruby.gitignore @356fd7b (2026-09-11) · CC0-1.0

Template yang sering dipakai bersama

Penjelasan template lainnya