Created
September 27, 2023 16:46
-
-
Save leighklotz/4cd927cca73c666037dbb5b509d3a91f to your computer and use it in GitHub Desktop.
list-branches.sh
This file contains hidden or 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
| #!/bin/bash | |
| for branch in $(git branch | sed -e 's/[*]//') | |
| do | |
| echo -ne "${branch}\tis contained in these branches:\t" | |
| git branch --contains "${branch}" | tr '\n*' ' ' | sed -e "s/\<${branch}\>//" | |
| echo | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment