Last active
July 9, 2019 07:35
-
-
Save Nikkely/1e0f67b014ee9d2e512538a9ad51ffca 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
"Marged" | |
for branch in `git branch -r --merged | grep -vE "/master$|/develop$"` | |
do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an" $branch | head -n 1` \\t$branch; | |
done | sort -r | |
"No-Marged" | |
for branch in `git branch -r --no-merged | grep -vE "/master$|develop$"` | |
do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch | head -n 1` \\t$branch; | |
done | sort -r | |
" delete remote | |
git branch -r --merged | grep -vE "/master$|/develop$" | sed -e 's/.*origin\///' | xargs -I % git push --delete origin % | |
" delete local | |
git branch --merged | grep -vE "/master$|/develop$" | xargs -I % git branch -d % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment