Skip to content

Instantly share code, notes, and snippets.

@shyazusa
Last active October 24, 2016 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shyazusa/a6ca565f6b41221b7ac476421fdaf680 to your computer and use it in GitHub Desktop.
Save shyazusa/a6ca565f6b41221b7ac476421fdaf680 to your computer and use it in GitHub Desktop.
よく使いはしないけれどまとめておきたかったGitの設定

よく使いはしないけれどまとめておきたかったGitの設定

あまりよく使うものではないけれど,最近個人的にたまによく使うことが多い設定をまとめてみました.

「これも追加しておいたら?」とか,「ここ間違ってる」とか「ここもっと楽に出来る」とかそういうのがあれば編集リクエストでも,コメントでも良いので頂けると嬉しいです.

user.nameuser.emailの設定

設定の確認

$ git config --global --list
user.name=shy_azusa
user.email=shy.azusa@gmail.com

設定方法

$ git config --global user.name 名前
$ git config --global user.email メールアドレス

入力例

$ git config --global user.name shy_azusa
$ git config --global user.email shy.azusa@gmail.com

remoteの設定

設定の確認

$ git remote -v
origin git@github.com:shyazusa/origin.git (fetch)
origin git@github.com:shyazusa/origin.git (push)
github git@github.com:shyazusa/github.git (fetch)
github git@github.com:shyazusa/github.git (push)

設定方法

追加

$ git remote add リモート名 リモートのURL

編集

$ git remote set-url リモート名 リモートのURL

削除

$ git remote rm リモート名

入力例

$ git remote add github git@github.com:shyazusa/add.git
$ git remote set-url github git@github.com:shyazusa/edit.git
$ git remote rm github

その他設定

設定方法

gitの補正をオンにする

$ git config --global help.autocorrect 待ち時間

変更のdiffを見ながらコミットメッセージを書く

$ git config --global commit.verbose trueかfalseでオンオフ

入力例

$ git config --global help.autocorrect -1
$ git config --global commit.verbose true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment