How do I show all flagged commits not available to a branch?

My local repo sometimes has commit tagged tags without any children and no branch name.

I originally created these by splitting the main development line, setting the tag, and then deleting the branch. They don't get garbage collected because the tag keeps the line open.

Is there a command that will identify all such commits? It doesn't matter if this command actually finds the branch heads, as I can easily identify them with git show-ref --heads

.

I would like to clean them up (either remove the tags, or the GC that I no longer need, or install a branch there, which I think fits better).

+3


source to share


1 answer


Use git tag

to list all tags. Check if they are available from one or more branches.

Something like:



git tag | while read tag
do
    echo Tag is $tag
    git branch -a --contains $tag
    echo ""
done

      

+3


source







All Articles