2011年10月13日 星期四

Show current branch only

只要顯示目前的 branch $git rev-parse --abbrev-ref HEAD 這要 git 1.6.3 以上版本才有效

雖然$git branch 會 show 出所有 branch 和目前 branch,
但是跟 repo 一起用的時候就有麻煩:
--- 要知道目前每一個 project 的 branch 是...

用以下 command 就可以清楚列出: $repo forall -p -c 'git rev-parse --abbrev-ref HEAD'

ref:
http://stackoverflow.com/questions/1417957/show-just-the-current-branch-in-git