github/gitignore · Global/macOS.gitignore

macOS .gitignore 템플릿 해설

macOS.gitignore가 .DS_Store, ._ 리소스 포크, Icon 파일, Spotlight·Time Machine·휴지통 폴더를 무시하는 이유와 전역 gitignore에 두는 방법을 설명합니다.

생성기에서 열기 VisualStudioCode, JetBrains, Xcode, Node 함께 열기

macOS.gitignore는 Finder와 macOS 파일 시스템이 사용자 몰래 만드는 메타데이터 파일을 막는다. 프로젝트 내용과 무관하므로 원래는 저장소가 아니라 개인 전역 gitignore(core.excludesFile)에 두는 것이 권장되는 템플릿이다.

현실적으로는 팀원 모두가 전역 설정을 하지 않기 때문에 .DS_Store가 커밋되는 사고가 흔하다. 그래서 프로젝트 .gitignore에 함께 넣는 팀도 많다.

규칙별 해설

패턴무엇을, 왜 무시하나
.DS_Store.localizedFinder 메타데이터.DS_Store는 Finder가 폴더마다 만드는 보기 설정(아이콘 위치, 정렬) 파일이다. 폴더를 열기만 해도 생기고, 파일 이름 목록이 들어 있어 의도치 않게 정보가 드러날 수도 있다.
._*.AppleDouble.LSOverride리소스 포크(AppleDouble)HFS+·APFS가 아닌 볼륨(FAT, 네트워크 공유)에 파일을 복사할 때 확장 속성을 담으려고 만드는 ._파일명 짝 파일이다.
.VolumeIcon.icns사용자 지정 아이콘볼륨 아이콘 파일이다. 폴더 사용자 지정 아이콘은 이름 끝에 줄바꿈 문자(CR)가 들어간 Icon 파일로 저장되는데, 템플릿은 이를 Icon[\r] 형태의 브래킷 패턴으로 잡는다.
.Spotlight-V100.fseventsd.Trashes.TemporaryItems.DocumentRevisions-V100시스템 인덱스·휴지통외장 디스크나 볼륨 루트에 생기는 Spotlight 색인, 파일 시스템 이벤트 로그, 휴지통, 문서 버전 저장소다.
.com.apple.timemachine.donotpresent.com.apple.timemachine.supportedBackups.backupdb.MobileBackupsTime MachineTime Machine 백업 디스크에 생기는 표시 파일과 백업 폴더다.
.AppleDB.AppleDesktopNetwork Trash FolderTemporary Items.apdiskAFP 공유 폴더AFP(Apple Filing Protocol) 파일 서버가 공유 볼륨에 만드는 데이터베이스와 폴더다. 이름에 공백이 있어도 gitignore 패턴은 그대로 쓰면 된다.
__MACOSX/압축 해제 부산물macOS에서 만든 zip을 다른 도구로 풀 때 나오는 리소스 포크 폴더다.

실무에서 주의할 점

원본 템플릿

macOS.gitignore규칙 44줄
# General.DS_Store.localized__MACOSX/.AppleDouble.LSOverrideIcon[
]# Resource forks._*# Files and directories that might appear in the root of a volume.DocumentRevisions-V100.fseventsd.Spotlight-V100.TemporaryItems.Trashes.VolumeIcon.icns.com.apple.timemachine.donotpresent.com.apple.timemachine.supported.PKInstallSandboxManager.PKInstallSandboxManager-SystemSoftware.hotfiles.btree.vol.file.disk_label*lost+found.HFS+ Private Directory Data[
]# Directories potentially created on remote AFP share.AppleDB.AppleDesktopNetwork Trash FolderTemporary Items.apdisk# Mac OS 6 to 9Desktop DBDesktop DFTheFindByContentFolderTheVolumeSettingsFolder.FBCIndex.FBCSemaphoreFile.FBCLockFolder# Quota system.quota.group.quota.user.quota.ops.group.quota.ops.user# TimeMachineBackups.backupdb.MobileBackups.MobileBackups.trashMobileBackups.trashtmbootpicker.efi

템플릿 출처: github/gitignore/Global/macOS.gitignore @356fd7b (2026-09-11) · CC0-1.0

함께 쓰는 템플릿

다른 템플릿 해설