Help us understand the problem. What is going on with this article?

まだ .gitconfig に core.excludesfile を設定しているの?

More than 3 years have passed since last update.

グローバルな .gitignore を設定するとき、よくある記事の説明が、

    excludesfile = /home/${USER}/.gitignore_global

をして、 ${HOME}/.gitignore_global を置くと。


man gitignore を見ると

Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary
files generated by the user’s editor of choice) generally go into a file specified by
core.excludesFile in the user’s ~/.gitconfig. Its default value is
\$XDG_CONFIG_HOME/git/ignore. If \$XDG_CONFIG_HOME is either not set or empty,
\$HOME/.config/git/ignore is used instead.

曰く、core.excludesFile のデフォルト値は $XDG_CONFIG_HOME/git/ignore$XDG_CONFIG_HOMEが空の時は $HOME/.config/git/ignore が使われます。特別な理由が無い限り、 $HOME/.config/git/ignore にグローバルな設定を置くのがgitの流儀となります。


Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away