global gitignore file
$ echo `.DS_Store` > ~/.gitignore
$ git config --global core.excludesfile ~/.gitignoreLast updated
To create a global git ignore that apply across all git repository
$ echo `.DS_Store` > ~/.gitignore
$ git config --global core.excludesfile ~/.gitignoreLast updated