gitのカスタマイズをする時によく出てくるのだけど、どういう機能なのかよくわかっていなかったので少し調べたメモ。
公式ドキュメントの説明メモ
公式ドキュメント では、以下のように説明されていた。冒頭部分の概要のみ、メモしておく。公式ドキュメントでは、記法やsample fileなど豊富にまとまっているので必要に応じて読むとよさそうだった。
The Git configuration file contains a number of variables that affect the Git commands' behavior.
- Git configuration file とは
git(1)コマンドの挙動をfileベースでカスタマイズする機能。
The files .git/config and optionally config.worktree (see the "CONFIGURATION FILE" section of git-worktree[1]) in each repository are used to store the configuration for that repository, and $HOME/.gitconfig is used to store a per-user configuration as fallback values for the .git/config file.
- 各gitリポジトリ配下に、
.git/configとconfig.worktree(こっちはオプション) を配置することで、各リポジトリで別々の設定値を使い分けることができる。 $HOME/.gitconfig配下にファイルを置くことで、ユーザー毎に別個の設定値を使い分けることもできる。
The file /etc/gitconfig can be used to store a system-wide default configuration.