LoginSignup
4
1

More than 5 years have passed since last update.

git aliasのすすめ

Last updated at Posted at 2018-06-18

aliasとは?

コマンドの呼び出しを自分でカスタマイズ出来る機能です。git checkoutとか毎回打ち込むのは面倒なのでgit coで呼び出したりして楽をします。

設定方法

設定方法は簡単です。.gitconfigファイルに[alias]を追加してあげます。
こんな感じ↓↓↓

$ cd
$ pwd
/Users/user_name
$ ls -a #不可視ファイルですので`-a`オプションを付けないと表示出来ません。
.CFUserTextEncoding
.DS_Store
.Trash
.android
略
.gitconfig #<=これ
$ vim .gitconfig 
  • vimで開いて[alias]の部分を下図のように記述してください。(他のeditorでもOK) スクリーンショット 2018-06-18 12.27.04.png

aliasの色々

僕はこんな感じで設定してます。

[alias]
        co = checkout
        ci = commit
        st = status
        br = branch
        pl = pull
        ps = push

他にもオススメのaliasあったら教えて欲しいです。

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