How to find all refs that contain a commit in their history in git
Lets assume you have the following structure in git A <-- refs/heads/somebranch | B | \ C D <-- refs/tags/TAG1 | | E F | | \ G H I <-- refs/heads/branch1 | J <-- refs/heads/master Now I want to find all refs that contain commit B in their history. So it would be nice if I could do $ git refs --contains B refs/tags/TAG1 refs/heads/branch1 refs/heads/master I took a look at the git decumentation and found git branch -a --contains <commit_id> which lists all branches that contain a commit_id . $ git branch -a --contains 4af9822 master remotes/origin/someBranch ... and I found the command git tag