[Git] How to Set Files to Ignore in All Git Repositories Using Global .gitignore
In Git, I created a .gitignore
that applies to all repositories to prevent accidentally committing files like .DS_Store
that I want to ignore.
echo .DS_Store >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore
Now, files specified in .gitignore under the home directory will be ignored in all git repositories.
By the way, this is properly documented in the .gitignore automatically generated by git init.
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
That’s all from the Gemba.
・Various Convenient Settings You Want to Do When Starting to Use Git : Asial Blog
・Setting Global .gitignore to Configure Files to Ignore in All git Repositories | WEB Design Tips