GitOmit - t-sakashita/rokko GitHub Wiki

gitコマンドの省略法

エイリアスの作成

git config --global alias.co checkout
git config --global alias.st 'status'
git config --global alias.ci 'commit -a'
git config --global alias.di 'diff'
git config --global alias.br 'branch'

http://tobysoft.net/wiki/index.php?git%2F%A5%B3%A5%DE%A5%F3%A5%C9%A4%CE%BE%CA%CE%AC(alias)%C0%DF%C4%EA%A4%F2%A4%B9%A4%EB%CA%FD%CB%A1

~/.bashrcに以下を書き込む

alias gco="git checkout"
alias gst="git status"
alias gci="git commit -a"
alias gdi="git diff"
alias gbr="git branch"

push/pullする時にブランチ名を省略する方法

リポジトリの各ブランチごとに以下を実行

git config branch.master.remote origin
git config branch.master.merge refs/heads/master

すると、.git/configに以下の2行が追記される。

[branch "master"]
remote = origin
merge = refs/heads/master

参考: http://blog.elkc.net/?p=585

引数なしで、以下のように実行できる。

git push
git pull