Created
July 3, 2014 16:14
-
-
Save kaneshin/2486fa2c29ee39582ad2 to your computer and use it in GitHub Desktop.
This file contains 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
alias blp='bl | peco | chbarg' | |
function chbarg() | |
{ | |
target=`awk '{print $1}' | sed -e 's/^remotes\///'` | |
branch=`echo $target | awk '{sub("/", "-"); print $0;}'` | |
git checkout -b $branch $target | |
if [[ $? != 0 ]]; then | |
git checkout $branch | |
fi | |
} | |
function bl() | |
{ | |
branches=`git branch -a 2> /dev/null | sed -e 's/^..//'` && tags=`git tag` | |
result=`echo $branches "\n" $tags | awk '{print $1}'` | |
while read LINE | |
do | |
echo $LINE " " `git log --oneline -n 1 $LINE` | |
done <<< $result | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment