A simple .gitignore template optimised for macOS users working primarily with Word, Excel, and Affinity apps. It excludes system files, temporary backups, and autosaves, while keeping your main project files (such as .docx, .xlsx, .afphoto) tracked in Git.
This template is ideal if you:
- Create non-code projects using Markdown, documents, or images.
- Use Git to version notes, documentation, or artwork.
- Want to avoid cluttering commits with
.DS_Storeand temporary files.
This template excludes:
-
macOS system files
.DS_Store,._*,.AppleDouble,.Spotlight-V100, and others. -
Temporary and backup files
*.tmp,*.bak,*~,*.swp, etc. -
Microsoft Office temporary files
~$*,*.wbk,*.xlk, etc. -
Affinity autosave and preview files
*.autosave,*.afdesign-preview, and similar.
This .gitignore does not exclude the following, so these will remain tracked:
.docx,.xlsx.afphoto,.afdesign,.afpub.md,.jpg,.png,.pdf, and other common document/image formats
- Copy the contents of
macos.gitignoreinto your project's.gitignorefile. - If you've already committed files you want ignored, run:
git rm -r --cached .
git add .
git commit -m "Apply .gitignore"Pull requests and suggestions are welcome, especially if you use other macOS-native apps with known temporary file formats.
MIT Β© 2025 Karl Horning
Made with β€οΈ by Karl Horning