エイリアスでGitの作業を高速化する

作成日

2019年2月22日

エイリアス=ショートカットです.エイリアスを設定することで長いコマンドを打つ必要がなくなるので,快適に作業ができるようになります.

以下,設定しておくと便利なコマンド例を書いておきます.

terminal
$ git config --global alias.br branch
$ git config --global alias.co checkout
$ git config --global alias.ci commit
$ git config --global alias.st status

以上の方に設定すると,例えばブランチを切り替えるときの操作は次のように簡略化できます.

terminal
# 元々のコマンド
$ git checkout master

# 設定したエイリアス
$ git co master

コマンドの内容は自分で任意に決めることができます.また,オプション付きのコマンドを登録することも可能です.

terminal
$ git config --global alias.unstage 'reset HEAD --'

https://git-scm.com/book/ja/v2

mktia's note

Research & Engineering / Blockchain / Web Dev

© 2017-2025 mktia. All rights reserved.