Created
November 9, 2010 02:00
-
-
Save tommeier/668606 to your computer and use it in GitHub Desktop.
Analyse your remote branches in origin (run in a git repo, with remote of origin)
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
function analyse_remote_branches { | |
printf "\n\n== Loading remote branches..\n" | |
git gc --prune=now | |
git remote prune origin | |
git for-each-ref --shell --format="%(refname)" refs/remotes/origin | \ | |
while read branch | |
do | |
branch_name=${branch/refs\/remotes\/origin\//} | |
printf "\nRemote Branch : ${branch_name}\n" | |
result=`git log master..origin/${branch_name//\'/} --pretty=format:" -------> %h | %ar | %an | %s" --abbrev-commit --date-order --decorate -n 4` | |
if [ "$result" == "" ]; then | |
echo " <--> Commits all merged in master" | |
else | |
echo " --> Commits not in master : " | |
printf "$result\n" | |
fi | |
echo "---" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment