How to search branch names in git?

I’d like to find a specific branch, I know that it’s name would contain a specific substring (the id of the issue from our bug tracker) but I don’t know the whole name of the branch (this is what I want to find out).

How can I search for this branch?

  • Can I do a wildcard (*) search on
  • Is there an Full Text Search Limit in opengrok?
  • How to search through all Git and Mercurial commits in the repository for a certain string?
  • Github: Find repositories ordered by creation date
  • Git search all diffs
  • Is it possible to search through Git Stash items?
  • How can I search my directory tree for contents within a file for a git managed project?
  • How to tell if a Github repository is an R package
  • 5 Solutions collect form web for “How to search branch names in git?”

    git branch --all | grep <id>
    git branch -a | grep selector


    git branch -r | grep selector

    -a shows all local and remote branches, while -r shows only remote branches.

    Building of the answers that others have given, I added this to my .gitconfig

      findb = "!f(){ git branch -ra | grep $1; }; f"

    So on the command line I can type git findb BUG-123

    assuming that you are using git hub there is a drop down list for your branches and tags in that drop down menu there is a search area. you can use that search area to search for your branch name

    Really late, but I found a better solution: git branc --list <pattern>, no need to go to grep.

    This works with wildcards (*) as well, so you can do use git branch --list *<id>* to find your branch.

    Git Baby is a git and github fan, let's start git clone.