LoginSignup
5
5

More than 3 years have passed since last update.

Gitのユーザ情報設定メモ

Last updated at Posted at 2020-03-01

git commitする時に必要な、ユーザ名とメールアドレス情報設定。
commitしようとした時に空だと設定してねと怒られる。PCセットアップ時とかにいつも忘れる。
(エラーメッセージ中でも以下のコマンドを実行せよと言われている…)

globalで設定する場合

(その端末の)ユーザ全体で適用される。

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

確認

$ git config --global -l

以下の行が入力した通りに表示されていればOK。

user.name=Your Name
user.email=you@example.com

localで設定する場合

複数アカウントを使っている場合などに、特定ポジトリだけの設定をしたい場合は、そのリポジトリ内で、--globalを外して実行すればOK。

$ git config user.email "you@example.com"
$ git config user.name "Your Name"

確認

$ git config --local -l

参考

もっとしっかり書いてあった…
gitconfig の基本を理解する - Qiita

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5