0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

私の使ってるGitエイリアスまとめ

Posted at

GitをCLIで使っていく場合、git pull origin masterとか、git commit -m "some feature"とか、キーボードで打つ文字量は意外にも多いです。

そこで、gitにはエイリアスと呼ばれる、特定のコマンドに別のコマンドを割り当てる機能があります。
これによって、地味に面倒なコマンド入力を効率化することができます。

今回は私が設定しているエイリアスを設定したいと思います。

設定方法

$ git config --global alias.fo 'fetch origin'

一個一個設定するのが面倒なら、.gitconfigに直接書き込んでもOKです。

私が設定しているエイリアス

前提として、私が所属しているチームでは開発の軸がmasterブランチなのでこれに最適化しています。(リリース用のブランチが別にあります)
ブランチ運用に合わせて、適宜変えるといいと思います。

[alias]
	unstage = reset HEAD --
	pom = pull origin master
	cm = commit -m
	s = status
	ss = switch
	nb = switch -c
	sm = switch master
	p = push
	l = log
	b = branch
	aa = add .
	fo = fetch origin

ポイントとしては、キーボードでの押しやすさを重視しています。
たとえば、switchswとしていないのは、swが単純に押しにくいからです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?