プロジェクトで除外
.gitignore に記述する
ローカル環境で除外
.git/info/exclude に記述する。
.git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
target
または
$ git config --global core.excludesfile target
に書く。