とあるエンジニアの闇歴史帳

コピペで使える便利Wiki ※現在構築中です。

ユーザ用ツール


サイドバー

言語

サーバ関連

ツール

API

読み物

その他

git:git_config_alias

[Git] コマンドに別名をつける

略称が使えるSubversion等から移行してくると、毎回フルネームで入力させられるgitには少しうんざりさせらる、そんな時はエイリアスの設定をします。

git config

$ git config --global alias.st status
$ git st
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	foo
nothing added to commit but untracked files present (use "git add" to track)

同じ要領で他のコマンドにも好きな名前をつけることができます。 statusやcommitなどは頻繁に打ちますから、その恩恵も一塩ですね。

~/.gitconfig

上記コマンドを実行すると、ホームディレクトリ直下に設定が記録されます。 コマンドを実行せず、このファイルを直接書き換えてもOKです。

$ cat ~/.gitconfig 
[user]
	name = Makito Katsube
	email = katsube@eden.localhost
[color]
	ui = auto
[alias]
	st = status
	co = commit
	ck = checkout

参考

= Gitを使い始めたらやっておきたい便利な設定いろいろ : http://blog.asial.co.jp/845
= gitで便利なエイリアス達 : http://qiita.com/peccul/items/90dd469e2f72babbc106

関連書籍

failed to fetch data: unkown error

failed to fetch data: unkown error

failed to fetch data: unkown error

failed to fetch data: unkown error

関連ページ

git/git_config_alias.txt · 最終更新: 2020/06/23 14:10 (外部編集)