There is no special
git ignore command.
.gitignore file located in the appropriate place within the working copy. You should then add this
.gitignore and commit it. Everyone who clones that repo will than have those files ignored.
Note that only file names starting with
/ will be relative to the directory
.gitignore resides in. Everything else will match files in whatever subdirectory.
You can also edit
.git/info/exclude to ignore specific files just in that one working copy. The
.git/info/exclude file will not be committed, and will thus only apply locally in this one working copy.
You can also set up a global file with patterns to ignore with
git config --global core.excludesfile. This will locally apply to all git working copies on the same user’s account.
git help gitignore and read the text for the details.