本文介绍了< pattern>的格式是什么?在git-branch --list的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为标题,我已经阅读了该手册但徒劳.

As title, I have read the manual but in vain.

我发现*可以是通配符模式匹配.

What I found is that a * can be wildcard pattern matching.

git branch --list 'issues*6'
 issues/586
 issues/616

但是,它是我自己找到的,而不是在手册页中提到的.

However, it's found by myself instead of mentioned in manual page.

我想知道<pattern>的真正格式是什么.

I wonder what is the real format of <pattern>.

推荐答案

引用相同的您链接的手册页:

因此,至少根据文档,答案是它用作外壳通配符".当然,这是假定您知道短语"shell通配符"的含义-更重要的是,这是错误,因为在/上,直壳通配符将不匹配.

So the answer, at least according to the documentation, is that "it is used as a shell wildcard". This assumes, of course, that you know what the phrase "shell wildcard" means—and more importantly, it's wrong, since a straight shell wildcard would not match across the /.

文档应该说:该模式的行为与shell通配符/glob模式非常相似,不同之处在于,不对斜杠进行特殊处理,因此a*baccbac/cb以及a[bc/]*都匹配.匹配所有a/dabcdac/cbaccb."

The documentation should say something like: "The pattern acts much like a shell wildcard / glob pattern, except that slashes are not treated specially, so that a*b matches both accb and ac/cb, and a[bc/]* matches all of a/d, abcd, ac/cb, and accb."

示例:

$ git branch -a
  a/d
  abcd
  ac/cb
  accb
* master
$ git branch --list 'a*b'
  ac/cb
  accb
$ git branch --list 'a[bc/]*'
  a/d
  abcd
  ac/cb
  accb
$

这篇关于&lt; pattern&gt;的格式是什么?在git-branch --list的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 16:36