Use a substitution filter for branch names

git branch --all lists many branches, and I'm looking for one that contains line 1234 , which is the problem number in our project management system.

The following works in PowerShell, and I want to replace it with something agnostic.

 PS> git branch --all | where { $_ -like "*1234*" } 

How to do it with git and git alone?

+5
source share
1 answer

git branch --list "*1234*" does what you need. Or git branch --list \*1234\*

+8
source

Source: https://habr.com/ru/post/1234735/


All Articles