Created
February 14, 2024 00:06
-
-
Save jobwat/887e9f1c30f34bc45a4cedca4a013e30 to your computer and use it in GitHub Desktop.
list the remote branches with last commit authored by yourself
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
git branch -r | cut -d '/' -f 2- | grep -v '\->' | sort -u | while read branch; do [[ "$(git --no-pager log -n 1 --format='%ae' "origin/$branch" 2>/dev/null)" == "$(git config user.email)" ]] && echo $branch; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
suggestion:
git remote prune origin && git branch -r | cut -d '/' -f 2- | grep -v '\->' | sort -u | while read branch; do [[ "$(git --no-pager log -n 1 --format='%ae' "origin/$branch" 2>/dev/null)" == "$(git config user.email)" ]] && echo $branch; done
Addting
git remote prune
to the start clears any branches from the local repo that have been deleted on the remote.