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?

  • Upgrading Git Bash to run newly downloaded ruby 2.0.0
  • Are there any good workarounds to the GitHub 100MB file size limit for text files?
  • Is there any git hook for pull?
  • Cygwin git fork() error on pull
  • Merge part of a pull request
  • rebase reverted merged branch
  • How to force GIT post-receive hook not to be executed by the client
  • How to duplicate a git repository? (without forking)
  • IntelliJ IDEA GitHub integration creates the repository, but gets “couldn't authorize” error trying to push
  • How to change default branch when using arc diff?
  • Git push failed: can not push specific file to remote repo
  • Remove file from amended commit
  • 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.