--global, --system のちがい
git config
の設定には、--global
や--system
のオプションによって、その設定が影響する範囲が違ってくる
オプション | 設定が影響する範囲 | 設定ファイルの保存場所 |
---|---|---|
なし | 各リポジトリの中だけ | 各リポジトリの.git/config
|
--global |
ログインユーザー環境 | ~/.gitconfig |
--system |
OS環境全体 | Gitの環境による1 |
設定が競合する場合、
オプションなし > --global
> --system
の順で優先される
1.
- etc/gitconfig
- /opt/local/gitconfig
- usr/local/git/etc/gitconfig