I need to find and list the branches that are
- merged
- not merged
- merged but not deleted
from multiple projects and multiple repositories with single script from bit bucket and also the report should be printed in this format
project name: repo name: branch name: last commit date: author name:
I tried this in shell script
#!/bin/sh
echo "Merged branches"
for branch in `git branch -r --merged | grep -v HEAD`;
do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch
| head -n 1` \\t$branch; done | sort -r
echo ""
echo "Not merged branches"
for branch in `git branch -r --no-merged | grep -v HEAD`;
do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch |
head -n 1` \\t$branch; done | sort -r
by using these i can fetch only in that particular repo. how to list all the projects and repos and execute these git commands?