LoginSignup
124
129

More than 5 years have passed since last update.

最低限しておくといいgitconfigの設定

Last updated at Posted at 2017-01-17

最低限しておくといいgitconfig の設定メモ。
※Windows向け

user.name , user.email

ユーザー名とメールアドレスは、Githubのusernameとmailaddressとそろえるといい。

git config --global user.name "{ユーザー名}"
git config --global user.email "{メールアドレス}"

core.ignorecase

falseにすると、ファイルの大文字・小文字を区別して認識する。

git config --global core.ignorecase false

core.quotepath

falseにすると、git statusで変更ファイル一覧を表示するときに、
日本語のファイル名が文字化けしないでちゃんと表示される。

git config --global core.quotepath false

core.safecrlf

trueにすると、改行コードが混在している場合は変換しないというオプション。

git config --global core.safecrlf true

core.autocrlf

falseにすると、コミット・チェックアウト時に改行コードの変換を行わない。

git config --global core.autocrlf false

core.editor

コミットするときにメッセージを編集する際に使用するエディタの設定。

git config --global core.editor 'C:\Program Files\Hidemaru\Hidemaru.exe' //cu8

エディタの設定は以下の記事が大変参考になった。
Git for Windows で日本語を使いたい

push.default

simpleに設定しておくと安全。
カレントブランチと同名のリモートブランチが存在する場合のみ、カレントブランチのpushが行われる。

git config --global push.default simple

credential.helper

Githubからソースを取得するのに、ユーザー名とパスワードを聞かれるが、
頻度が結構多いのでキャッシュしておく設定。

git config --global credential.helper wincred
124
129
4

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
124
129