.gitignore file is a very useful thing - if you use one. Personally i didn't, until recently. But there is one special file that allways bothered me in my workflow:
For this post, it doesn't matter what these files are or why they exist. What matters is that these small files are annoying because they are often created and committed without notice.
So here's a quick one-line command solution for anyone, who doesn't use a global
git config --global core.excludesfile "~/.gitignore" && echo .DS_Store >> ~/.gitignore
- configures the path to a global exclude file (we'll just call it
.gitignore, but it could also be .global_gitignore or somehting else) to the home directory (
~/), where your global
.gitconfigusually resides too.
- then this new
.gitignorefile is created in your home folder (if it doesn't already exists) and a new line with
*If you are already using a global .gitignore, i'll assume that you are already ignoring these type of files globally. If not - please do so, as it should not be necessary to ignore these an a per project basis.
Heres a quick gist if you want to bookmark this command.