全ての記事へ戻る

役に立つGit設定、コマンド

#git

Gitに関する便利な設定をまとめる内容です。

タイピングできればしたくない、少ないようにしたい場合、下記に便利な設定をやってみましょう

git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.sw switch
git config --global alias.rs restore
# 色付けでcommitのショート一覧を表示する
git config --global alias.l "log --pretty=format:'%C(yellow)%h %C(cyan)%ad %Cgreen%s%Creset' --date=short --color"
# vimをデフォルトエディターに設定する
git config --global core.editor vim

ユーザー情報を設定

git config --global user.email "<your email address>"
git config --global user.name "<your account name>"