git config コマンド
参考:
git-config | Git Documentation [Official]
使い方
設定を一覧で確認する。
$ git config --list
もしくは、--list
の短縮オプション -l
を使う。
$ git config -l
リポジトリの設定を確認する。
$ git config --local --list
ユーザー毎に全リポジトリに適用されるグローバル設定を確認する。
$ git config --global --list
全ユーザーに適用されるシステムの設定を確認する。
$ git config --system --list
どこで設定されているかを含めて一覧で確認する。
$ git config --show-origin --list
参考:
Gi tの設定を git config で確認・変更 | note.nkmk.me
git の設定が影響する範囲 (system / global / local) | らくがきちょう
最初の Git の構成 | Pro Git book [公式]
ユーザーの設定
コミット時に使われるユーザー名とメールアドレスの全リポジトリ共通の設定を確認する。
$ git config --global user.name $ git config --global user.email
コミット時に使われるユーザー名とメールアドレスを全リポジトリ共通で設定する。
$ git config --global user.name my_name $ git config --global user.email user@example.com
参考:
とりあえず .gitconfig をいじっとけという話。| ばいばいバイオ (kimoton.com)
リポジトリ毎にユーザーアカウントを使い分ける
コミット時に使われるユーザー名とメールアドレスのリポジトリにおける設定を確認する。
$ git config --local user.name $ git config --local user.email
コミット時に使われるユーザー名とメールアドレスをリポジトリ内で設定する。
$ git config --local user.name my_name $ git config --local user.email user@example.com
参考: