LoginSignup
0
0

More than 1 year has passed since last update.

Git コマンドにエイリアスをつける

Last updated at Posted at 2023-05-16

コマンドにエイリアスをつけることで、良く使うコマンドを短縮できる。以下のようにエイリアスを設定する。

$ git config --global alias.<エイリアス> <文>

なお、--globalオプションを付けないと、ある特定のプロジェクトでのみ使えるエイリアスとなる。

以下はおすすめの例

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

複数の単語を組み合わせることもできる。

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

これで、下の二つの入力は同じ意味になる。

$ git unstage file
$ git reset HEAD -- file


より詳しくはこちら

0
0
0

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
0
0