SourceTree
- 公式サイト( https://www.sourcetreeapp.com/download/ )から入れる
- 『Install Command Line Tools』しておく。(AppStore 版にはこれがない)
Tools
zsh 上で
brew install hub
go get github.com/motemen/ghq && cd ghq && sudo make install && cd .. && rm -rf ghq
Config
~/.gitconfig
[push]
default = simple
[credential]
helper = osxkeychain
[alias]
graph = log --graph --date=short --decorate=short --pretty=format:'\t%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'
gr = log --graph --date=short --decorate=short --pretty=format:'\t%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'
ci = commit --allow-empty
co = checkout
stat = status
st = status
whom = show --date=short -s --format=\"%Cgreen%h %Creset%cd %Cblue%cn %Creset%s\"
all-branch = branch --all --verbose
[merge]
ff = false
[ghq]
root = 'path-to-root'
git config --global core.editor 'subl -n -w'
cat <<__EOF > ~/.zsh/git.zsh
function peco-src () {
local selected_dir=$(ghq list -p | peco --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
zle -N peco-src
bindkey '^]' peco-src
__EOF
cat <<__EOF > ~/bin/peco-sha
#!/usr/bin/env zsh
peco --prompt 'Get SHA of >' | head -n 1 | perl -ne'/([0-9a-f]{6,})/ and print \$1;'
__EOF
chmod +x ~/bin/peco-sha