One of the nice things about git is that any given project can have two kinds of "ignore" files.
The obvious one is
.gitignore. You should use it to keep locally-produced project files out of the repository so that a "push" won't publish them to the master repository and clutter it up. So .gitignore redlines things like the
Maven target directory, backup file from editors and tools ("*.bak" and so forth), and other stuff of that nature.
But often I'll have local files that I don't want either git or .gitignore to know about. These are often to-do list files, scratchpad stuff, temporary data files and so forth. For that, there's
another ignore file you can create inside the
.git directory. That way you can include the .gitignore file as part of your archive set without polluting it with stuff that no one sharing the project should see.
The "~/.gitignore file" is yet another beastie. The "~" is Unix shorthand for your home directory, and thus it gets applied to ALL projects on
your user account. The command that started this
thread simply sets the user's git options globally to exclude that file. Or, in other words, to ignore $HOME/.gitignore.