天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。
- gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
- ↓これをBookmarkに登録してこのページで実行してみよー!
javascript:(function()%7Bvar%20s%3Ddocument.createElement(%27script%27)%3Bs.setAttribute(%27src%27,%27https://raw.github.com/teppeis/gistdeck/fix/gistdeck.js%27)%3Bdocument.getElementsByTagName(%27head%27)%5B0%5D.appendChild(s)%3B%7D)()%3B
- 複数行のcodeとかが微妙なのでスタイル修正してます。
- いろいろ微妙なのでたぶんもう使わないw
- Confluenceで作ったら便利かもね。
46834 s
11945 l
9471 co
6758 d
5657 add
5238 fs
4591 ci
4505 f
3640 pull
3074 b
2499 stash
2163 show
2161 push
2105 ln
1963 submodule
1379 dc
1274 st
1254 rebase
1132 rebase -i
762 push -u
735 help
669
参考: http://shokai.org/blog/archives/6186
[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 = current
[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がくっそ便利。svnではできなかった。svnでも指定できたみたいです。コメ欄参照 thanks! @thinca
- 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}
- lolcommits
- さーせん、ローカルのMacでは動きませんでした。。
- fugitive.vim
- tig
- hug & GitHub API (特にNotification)
社内勉強会用の資料です。