[Git] インストール後に初期設定として ~/.gitconfig(global)に設定するべき項目 [mac/Linux編]

目次

前提

  • gitの初期インストール後に設定
  • mac/Linuxが対象
  • 最低限をモットーに作成

設定コマンド

ユーザ名

git config --global user.name "username"

SNSアカウントやGithubのアカウントがオススメ。

メールアドレス

git config --global user.email "username@sample.com"

フリーランス用の問い合わせメールが好ましい。

エディタ指定

git config --global core.editor 'vim -c "set fenc=utf-8"'

vimを選択。emacsやvscodeもあり。

diffの色付け

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

色付けはautoで全て設定

~/.gitconfig で書く場合

[user]
        name = username
        email = username@sample.com
[core]
        autocrlf = input
        editor = vim -c \"set fenc=utf-8\"
[color]
        diff = auto
        status = auto
        branch = auto
よかったらシェアしてね!
  • URLをコピーしました!
目次