To prevent adding/commiting/pushing unwanted files, like for example .DS_Store
, one should have a global gitignore file.
Here is how you can set it up:
- Use the following command to set up a global gitignore:
The command above will write/create the following lines in the existing
git config --global core.excludesFile '~/.gitignore_global'
~/.gitconfig
:
[core]