/remove_DS_Store_git_hook

a git pre-commit hook that runs git rm --cached on macOS .DS_Store files

Primary LanguageShell

remove_DS_Store_git_hook

Usage

Move or symlink to (git repo)/.git/hooks/precommit

This hook does not just prevent a commit adding .DS_Store files, it actively removes any files called .DS_Store that have been git-add-ed from the repository index (not from the disk).

Modify the FORBIDDEN variable in the hook to exclude a different filename.

If you want to exclude filenames that match a pattern instead, https://stackoverflow.com/a/37038262