8
3

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 コマンドのエイリアスを紹介

Last updated at Posted at 2022-07-03

はじめに

@ohakutsu が alias の記事を書いていたので私も利用している alias を書いてみました

設定してる Git aliase

.gitconfig.zshrc は dotfiles レポジトリに保存しています

その中で Git に関連するもの ( かつ よく使うもの ) だけ記載します

Zsh

alias g='git'

Git

[alias]
	ad = add
	ci = commit
	co = checkout
	cop = !"git branch --all | tr -d '* ' | grep -v -e '->' | peco | sed -e 's+remotes/[^/]*/++g' | xargs git checkout"
	d1 = diff HEAD~
	d2 = diff HEAD~~
	d3 = diff HEAD~~~
	d4 = diff HEAD~~~~
	d5 = diff HEAD~~~~~
	dc = diff --cached
	delete-merged-branches = !git branch --merged | grep -vE '^\\*|master$|main$|develop$' | xargs -I % git branch -d %
	dmas = diff master
	dmai = diff main
	ds = diff --staged
	dw = diff --color-words
	fe = fetch
	ignore = "!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi"
	pl = pull
	st = status

Ref: https://github.com/mziyut/dotfiles/blob/master/.gitconfig

Reference

8
3
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
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?