git で短縮名のエイリアスを使う

git で短縮名のエイリアスを使う
#18 エイリアスを使ってみよう
http://dotinstall.com/lessons/basic_git/6718
を参考に
エイリアスについて学習
これは git のコマンドを短縮名でつかうというもの
例えば
git checkout
これを短縮したいなら
git config –global alias.co checkout
とする
これと同様に
status
branch
commit
これらも短縮で使えるように登録しておく
git config –global alias.st status
git config –global alias.br branch
git config –global alias.ci commit
こうしておくことで
bit branch を
git br
で行うことができる
Linux の場合、Tab キーによる補完機能を使えば
ある程度は楽できるけど
このエイリアスを設定することでよりやりやすくできる
設定したエイリアスについては
git config -l
とすることで確認が可能
私の環境の場合だと
core.editor=vim
alias.co=checkout
alias.st=status
alias.br=branch
alias.ci=commit
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
となっています

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です