Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gitのユーザ情報設定メモ

Last updated at Posted at 2020-03-02

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

7
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

Linked from these articles

Comments

No comments

Let's comment your feelings that are more than good

Qiita Advent Calendar is held!

Qiita Advent Calendar is an article posting event where you post articles by filling a calendar 🎅

Some calendars come with gifts and some gifts are drawn from all calendars 👀

Please tie the article to your calendar and let's enjoy Christmas together!

7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address