Grep Git Branch Names, Return Only Branches Whose Name Contain “Theme”

If I have a list of 48 remote branches for a repo, I can do

git branch -a

To list all of them, how do I grep through those to only return the ones whose name contains Theme?

  • Single quote usage for example Git commit refs in documentation
  • Are there issues with putting a “/” in a git tag name to create hierarchical/nested tags?
  • Conflict resolution merge commit seems incomplete
  • Issue in cloning projects from private gitlab server
  • hg equivalent of git add -p?
  • How do you use the Ubuntu command line to pull a project that's been uploaded onto Git?
  • “Not currently on any branch” after doing a commit
  • How is a Git Tag Object SHA1 Created?
  • git : empty ident name (for <>) not allowed
  • rebase - automatically continue if rerere resolved all conflicts
  • Xcode6 quits unexpectedly
  • Can't open ssh/authorized_keys of user
  • 3 Solutions collect form web for “Grep Git Branch Names, Return Only Branches Whose Name Contain “Theme””

    No need to use grep. You can just use git branch --list <pattern> where <pattern> can contain wildcards:

    git branch --all --list *Theme*
    

    The --all option will include remote branches in the search.

    Just use the pipe operator (|):

    git branch -a | grep Theme
    

    You could pipe the output to grep.

    git branch -a | grep Theme
    
    Git Baby is a git and github fan, let's start git clone.