Created
July 3, 2014 13:02
-
-
Save kentokento/50ad235b0c8a1212b032 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# show branches list & theses newest log -1 | |
branch="" | |
branches=`git branch --list` | |
while read -r branch; do | |
branch_name=${branch//\*\ /} | |
label=`git log -1 --pretty=format:'%s' $branch_name` | |
if expr "$branch" : "^[^\*].*" >/dev/null; then | |
echo -n " " | |
fi | |
printf "%-15s %s\n" "$branch" "$label" | |
done <<< "$branches" | |
# vi .gitconfig | |
# [alias] | |
# branch-label = !/home/user/branch-label.sh | |
# exsample | |
# * master hotfix hogehoge | |
# one one one commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Git branchで一緒に最新ログのメッセージも表示する。
適当なところにおいてコマンドで呼べるようにしておけば少し楽
vi .gitconfig
[alias]
branch-label = !/home/user/branch-label.sh