.gitignore pour macOS

44 règles d’exclusion pour macOS, prêtes à copier dans votre dépôt.

Système d'exploitation de bureau d'Apple

Le .gitignore complet pour macOS

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-09-17 17:00:39 UTC
# Technologies: macOS

### macOS ###
# macOS folder settings (Desktop Services Store)
.DS_Store
# macOS resource fork files
.AppleDouble
.localized
# macOS custom folder icon
.LSOverride
__MACOSX/
# macOS custom icon file (Icon^M)
Icon[
]
# macOS resource fork files
._*
# macOS version history
.DocumentRevisions-V100
# macOS file system events daemon
.fseventsd
# macOS Spotlight index
.Spotlight-V100
# macOS temporary files
.TemporaryItems
# macOS trash folder
.Trashes
# macOS AppleDB cache
.AppleDB
# macOS volume icon
.VolumeIcon.icns
# macOS desktop settings
.AppleDesktop
# macOS Time Machine marker
.com.apple.timemachine.donotpresent
.com.apple.timemachine.supported
# macOS network trash
Network Trash Folder
.PKInstallSandboxManager
# macOS temporary items
Temporary Items
.PKInstallSandboxManager-SystemSoftware
# macOS AppleTalk disk info
.apdisk
.hotfiles.btree
.vol
.file
.disk_label*
lost+found
.HFS+ Private Directory Data[
]
Desktop DB
Desktop DF
TheFindByContentFolder
TheVolumeSettingsFolder
.FBCIndex
.FBCSemaphoreFile
.FBCLockFolder
.quota.group
.quota.user
.quota.ops.group
.quota.ops.user
Backups.backupdb
.MobileBackups
.MobileBackups.trash
MobileBackups.trash
tmbootpicker.efi

Ce que ces règles macOS ignorent vraiment

Chaque motif ci-dessous, et pourquoi il a sa place dans votre .gitignore.

General

Motif Ce qu’il ignore
.DS_Store macOS folder settings (Desktop Services Store)
.AppleDouble macOS resource fork files
.localized General
__MACOSX/ General
.LSOverride macOS custom folder icon
Icon[ ] macOS custom icon file (Icon^M)

Resource forks

Motif Ce qu’il ignore
._* macOS resource fork files

Files and directories that might appear in the root of a volume

Motif Ce qu’il ignore
.DocumentRevisions-V100 macOS version history
.fseventsd macOS file system events daemon
.Spotlight-V100 macOS Spotlight index
.TemporaryItems macOS temporary files
.Trashes macOS trash folder
.VolumeIcon.icns macOS volume icon
.com.apple.timemachine.donotpresent macOS Time Machine marker
.com.apple.timemachine.supported Files and directories that might appear in the root of a volume
.PKInstallSandboxManager Files and directories that might appear in the root of a volume
.PKInstallSandboxManager-SystemSoftware Files and directories that might appear in the root of a volume
.hotfiles.btree Files and directories that might appear in the root of a volume
.vol Files and directories that might appear in the root of a volume
.file Files and directories that might appear in the root of a volume
.disk_label* Files and directories that might appear in the root of a volume
lost+found Files and directories that might appear in the root of a volume
.HFS+ Private Directory Data[ ] Files and directories that might appear in the root of a volume

Directories potentially created on remote AFP share

Motif Ce qu’il ignore
.AppleDB macOS AppleDB cache
.AppleDesktop macOS desktop settings
Network Trash Folder macOS network trash
Temporary Items macOS temporary items
.apdisk macOS AppleTalk disk info

Mac OS 6 to 9

Motif Ce qu’il ignore
Desktop DB Mac OS 6 to 9
Desktop DF Mac OS 6 to 9
TheFindByContentFolder Mac OS 6 to 9
TheVolumeSettingsFolder Mac OS 6 to 9
.FBCIndex Mac OS 6 to 9
.FBCSemaphoreFile Mac OS 6 to 9
.FBCLockFolder Mac OS 6 to 9

Quota system

Motif Ce qu’il ignore
.quota.group Quota system
.quota.user Quota system
.quota.ops.group Quota system
.quota.ops.user Quota system

TimeMachine

Motif Ce qu’il ignore
Backups.backupdb TimeMachine
.MobileBackups TimeMachine
.MobileBackups.trash TimeMachine
MobileBackups.trash TimeMachine
tmbootpicker.efi TimeMachine

Comment utiliser ce .gitignore pour macOS

  1. Copiez les règles macOS ci-dessus, ou téléchargez directement le fichier.
  2. Créez un fichier nommé .gitignore à la racine de votre dépôt Git et collez-y les règles.
  3. 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.
  4. Commitez le .gitignore pour que toute l’équipe partage les mêmes règles.

Autres modèles .gitignore Operating System

Voir tous les modèles Operating System