.git/info/exclude
を編集します。このファイルは( Mac の場合?)最初こうなっています。
# 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]
# *~
.DS_Store
書き方はルートに置かれている.gitignore
とまったく同じように書くことができます。例えばルートのdist
ディレクトリを除外したい場合は、
/dist
と追記するだけです。