LoginSignup
1
1

More than 1 year has passed since last update.

git_config設定

Last updated at Posted at 2022-03-26

よく忘れるのでメモ。

gitのconfig設定

一覧表示
$ git config --list
セットしたい時
$ git config --global {設定値}
外したい時
$ git config --global --unset {キーの名前(=より左側)}
{キーの名前(=より左側)}の補足
  • git config --listで表示させた時の、=より左側のことだよ!
    • 下記で言うと、alias.ci=commitが消えます。

スクリーンショット 2022-03-26 13.33.27.png

よく使う設定

初期設定

名前
//登録
$ git config --global user.name "{githubのユーザー名}"
//確認
$ git config user.name
email
//登録
$ git config --global user.email "{githubのemail}"
//確認
$ git config user.email
editor
//登録(下記はVSCode)
$ git config --global code.editor "code --wait"
//確認
$ git config core.editor

設定しておくと便利な設定

エイリアス(コマンド短くなって楽)
$ git config --global ailias.ci commit
$ git config --global ailias.st status
$ git config --global ailias.br branch
$ git config --global ailias.co checkout
masterにpullするときはリベース型にする
$ git config --global branch.master.rebase true
FastForwardせず、マージコミットを作るようにする
$ git config --global merge.ff false
1
1
1

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
1
1