Skip to content

Instantly share code, notes, and snippets.

@pierdom
Last active September 7, 2017 07:46
Show Gist options
  • Select an option

  • Save pierdom/7dcf7616dd5e587f9a7746de161ea76d to your computer and use it in GitHub Desktop.

Select an option

Save pierdom/7dcf7616dd5e587f9a7746de161ea76d to your computer and use it in GitHub Desktop.
[Ignore files in git] Remove and ignore specific file names (e.g., .DS_Store files on Macs) from git repositories #git #sysadmin

To remove all '.DS_STore' files in an existent git repo:

find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch

To permanently ignore '.DS_STore' files in GIT repos:

echo .DS_Store >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment