0
0

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 3 years have passed since last update.

gitconfigのsystemにデフォルトで設定されているalias

Last updated at Posted at 2020-11-19

小ネタというかただのメモ。ちなみにMacだと /usr/local/git/etc/gitconfig にsystemのgitconfigがあります。

git config --syetem --list で出るalias部分

Gitをサイトからダウンロードしたときに設定されているalias。パッケージマネージャ経由だと設定されていない?ようなので[alias]の部分だけメモ。結構便利でよく使っている。

[alias]
	s = status
	a = !git add . && git status
	au = !git add -u . && git status
	aa = !git add . && git add -u . && git status
	c = commit
	cm = commit -m
	ca = commit --amend # careful
	ac = !git add . && git commit
	acm = !git add . && git commit -m
	l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
	ll = log --stat --abbrev-commit
	lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
	llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
	d = diff
	master = checkout master
	spull = svn rebase
	spush = svn dcommit
	alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort

git aliasで設定されているalias(systemだけでなくglobalやlocalの設定も含む)が表示されるので便利です。あとはgit log系も色付けされていたりツリー表示されていたりとよく使います。

全体はこれ


[core]
	excludesfile = ~/.gitignore
	legacyheaders = false # >git 1.5
	quotepath = false

[user]
#	name = your name
#	email = your@name

[mergetool]
	keepBackup = true

[push]
	default = simple # [ matching | simple ]

[color]
	ui = auto
	interactive = auto

[repack]
	usedeltabaseoffset = true # >git 1.5

[alias]
	s = status
	a = !git add . && git status
	au = !git add -u . && git status
	aa = !git add . && git add -u . && git status
	c = commit
	cm = commit -m
	ca = commit --amend # careful
	ac = !git add . && git commit
	acm = !git add . && git commit -m
	l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
	ll = log --stat --abbrev-commit
	lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
	llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
	d = diff
	master = checkout master
	spull = svn rebase
	spush = svn dcommit
	alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort

[include]	# as of 1.7.10 https://github.com/git/git/commit/9b25a0b52e09400719366f0a33d0d0da98bbf7b0
	path = ~/.gitcinclude
	path = .githubconfig
	path = .gitcredential

#[github]
#	user =
#	token =

[diff]
	# git does copy/rename *detection*. if you want it to track copies/renames:
	# http://stackoverflow.com/questions/1043388/record-file-copy-operation-with-git
	# renames = copies

[diff "exif"]
	textconv = exif
[credential]
	helper = osxkeychain
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?