执行分支名称的通配符过滤器 [英] Do a wildcard filter of branch names

查看:106
本文介绍了执行分支名称的通配符过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git branch --all 列出了很多分支,我正在寻找一个包含字符串 1234 ,这是我们项目管理系统中的一个问题编号。



以下PowerShell中的工作,我想用shell不可知的替换它。

  PS> git分支--all | {$ _ -like* 1234 *} 

我们如何用 git git 单独存在?

解决方案

git branch --list* 1234 *可以满足您的需求。或 git branch --list \ * 1234\ *


git branch --all lists lots of branches, and I am looking for one that includes the string 1234, which is an issue number in our project management system.

The following works in PowerShell and I am wanting to replace it with something shell agnostic.

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

How do we do this with git and git alone?

解决方案

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

这篇关于执行分支名称的通配符过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆