.gitignore pour Ruby
26 règles d’exclusion pour Ruby, prêtes à copier dans votre dépôt.
Langage de programmation dynamique
Le .gitignore complet pour Ruby
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:27:18 UTC
# Technologies: Ruby
### Ruby ###
# Ruby gem package
*.gem
# Ruby compiled bytecode
*.rbc
# Configuration directory
/.config
# Installed files list
/InstalledFiles
# Package directory
/pkg/
# Test reports
/spec/reports/
# Code coverage reports
/coverage/
# RSpec examples
/spec/examples.txt
# Test temporary files
/test/tmp/
# Test version temp
/test/version_tmp/
# Temporary directory
/tmp/
# Data files
.dat*
# REPL history
.repl_history
# Build output directory
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/
/.yardoc/
/_yardoc/
/doc/
/rdoc/
/.bundle/
# Bundled gems
/vendor/bundle
/lib/bundler/man/
# RVM configuration
.rvmrc
.byebug_history
Ce que ces règles Ruby ignorent vraiment
Chaque motif ci-dessous, et pourquoi il a sa place dans votre .gitignore.
General
| Motif | Ce qu’il ignore |
|---|---|
*.gem |
Ruby gem package |
*.rbc |
Ruby compiled bytecode |
/.config |
Configuration directory |
/InstalledFiles |
Installed files list |
/pkg/ |
Package directory |
/spec/reports/ |
Test reports |
/coverage/ |
Code coverage reports |
/spec/examples.txt |
RSpec examples |
/test/tmp/ |
Test temporary files |
/test/version_tmp/ |
Test version temp |
/tmp/ |
Temporary directory |
Ignore Byebug command history file.
| Motif | Ce qu’il ignore |
|---|---|
.dat* |
Data files |
.repl_history |
REPL history |
build/ |
Build output directory |
*.bridgesupport |
Ignore Byebug command history file. |
build-iPhoneOS/ |
Ignore Byebug command history file. |
build-iPhoneSimulator/ |
Ignore Byebug command history file. |
/.yardoc/ |
# Documentation cache and generated files: |
/_yardoc/ |
Ignore Byebug command history file. |
/doc/ |
Ignore Byebug command history file. |
/rdoc/ |
Ignore Byebug command history file. |
/.bundle/ |
# Environment normalization: |
/vendor/bundle |
Bundled gems |
/lib/bundler/man/ |
Ignore Byebug command history file. |
.rvmrc |
RVM configuration |
.byebug_history |
Ignore Byebug command history file. |
Comment utiliser ce .gitignore pour Ruby
- Copiez les règles Ruby ci-dessus, ou téléchargez directement le fichier.
- Créez un fichier nommé .gitignore à la racine de votre dépôt Git et collez-y les règles.
- Si certains de ces fichiers sont déjà suivis, lancez git rm -r --cached . puis recommitez — Git n’applique les règles d’exclusion qu’aux fichiers non suivis.
- Commitez le .gitignore pour que toute l’équipe partage les mêmes règles.