天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisのforkです。
[user]
name = teppeis
email = [email protected]
[include]
path = .gitconfig.local
[core]
excludesfile = ~/.gitignore
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
pager = less -r
editor = vi
[color]
ui = auto
[push]
# push only the current branch
default = tracking
[branch]
autosetuprebase = always
[merge]
# from 1.7.6
ff = false
[pull]
# from 1.7.9
rebase = true
[alias]
# http://oli.jp/2012/git-powerup/
# http://blog.blindgaenger.net/advanced_git_aliases.html
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
b = branch -a
br = browse-remote
ci = commit
co = checkout
d = diff
dc = diff --cached
di = diff
dic = diff --cached
f = fetch --prune
fs = !git f && git su
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >> .gitignore
info = remote show origin
l = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset'
ll = log --stat --abbrev-commit
ln = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset' --name-status
lp = log --oneline -n 20 -p
ls = log --stat --abbrev-commit -n 1 # display previous log
s = status --short --branch
st = status
su = submodule update
# git-browse-remote
# http://subtech.g.hatena.ne.jp/motemen/20120917/1347889804
[web]
browser = google-chrome
[browse-remote "github.com"]
top = https://{host}/{path}
ref = https://{host}/{path}/tree/{short_ref}
rev = https://{host}/{path}/commit/{commit}
[browse-remote "github.dev.cybozu.co.jp"]
top = https://{host}/{path}
ref = https://{host}/{path}/tree/{short_ref}
rev = https://{host}/{path}/commit/{commit}
[browse-remote "git.dev.cybozu.co.jp"]
top = http://{host}/graph/{path[1]}
ref = http://{host}/changelog/~br={short_ref}/{path[1]}
rev = http://{host}/changelog/{path[1]}?cs={commit}
[browse-remote "review.dev.cybozu.co.jp"]
top = http://{host}/graph/{path[1]}
ref = http://{host}/changelog/~br={short_ref}/{path[1]}
rev = http://{host}/changelog/{path[1]}?cs={commit}
ないしょの鍵とかトークンとかを別ファイルで保存できるよ(git 1.7.10から)。
[include]
path = .gitconfig.local
オレオレgitignoreがくっそ便利。
- repo/.gitignore : 特定リポジトリで全メンバー共有
- repo/.git/info/exclude : 特定リポジトリで自分だけ
- core.excludesfile : 全リポジトリで自分だけ
[core]
excludesfile = ~/.gitignore
https://github.com/github/gitignore
[core]
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
pager = less -r
editor = vi
[color]
ui = auto
[push]
# push only the current branch
default = tracking
[branch]
autosetuprebase = always
[merge]
# from 1.7.6
ff = false
[pull]
# from 1.7.9
rebase = true
- いまググると「gitではmerge --no-ff, pull --rebaseをデフォルトにできない」っていう昔の記事がたくさんひっかかるけど、できるようになってるよ。
- man git-config するといいよ。
このリンクがオススメ
[alias]
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
b = branch -a
br = browse-remote
ci = commit
co = checkout
d = diff
dc = diff --cached
di = diff
dic = diff --cached
f = fetch --prune
fs = !git f && git su
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >> .gitignore
info = remote show origin
l = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset'
ll = log --stat --abbrev-commit
ln = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset' --name-status
lp = log --oneline -n 20 -p
ls = log --stat --abbrev-commit -n 1 # display previous log
s = status --short --branch
st = status
su = submodule update
- git help logしたらフォーマットの意味が分かるよ。
- 個人的にはauthor date (%a系) よりもcommitter date (%c系) が好きです。
- コマンドラインから現在のブランチのgithubページとかをブラウザで一発で開ける神ツール。
- 本当に神ツール。
- http://subtech.g.hatena.ne.jp/motemen/20120917/1347889804
[web]
browser = google-chrome
[browse-remote "github.com"]
top = https://{host}/{path}
ref = https://{host}/{path}/tree/{short_ref}
rev = https://{host}/{path}/commit/{commit}
[browse-remote "github.dev.cybozu.co.jp"]
top = https://{host}/{path}
ref = https://{host}/{path}/tree/{short_ref}
rev = https://{host}/{path}/commit/{commit}
[browse-remote "git.dev.cybozu.co.jp"]
top = http://{host}/graph/{path[1]}
ref = http://{host}/changelog/~br={short_ref}/{path[1]}
rev = http://{host}/changelog/{path[1]}?cs={commit}
[browse-remote "review.dev.cybozu.co.jp"]
top = http://{host}/graph/{path[1]}
ref = http://{host}/changelog/~br={short_ref}/{path[1]}
rev = http://{host}/changelog/{path[1]}?cs={commit}
- fugitive.vim
- tig
- hug & GitHub API (特にNotification)