Skip to content

Commit

Permalink
fix 2.2章 星号(*)显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
hasban12138 authored and networm committed Nov 29, 2023
1 parent a11fb45 commit a79913e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/02-git-basics/sections/recording-changes.asc
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ $ cat .gitignore
* 要忽略指定模式以外的文件或目录,可以在模式前加上叹号(`!`)取反。

所谓的 glob 模式是指 shell 所使用的简化了的正则表达式。
星号(`*`)匹配零个或多个任意字符;`[abc]` 匹配任何一个列在方括号中的字符
星号(`\*`)匹配零个或多个任意字符;`[abc]` 匹配任何一个列在方括号中的字符
(这个例子要么匹配一个 a,要么匹配一个 b,要么匹配一个 c);
问号(`?`)只匹配一个任意字符;如果在方括号中使用短划线分隔两个字符,
表示所有在这两个字符范围内的都可以匹配(比如 `[0-9]` 表示匹配所有 0 到 9 的数字)。
使用两个星号(`**`)表示匹配任意中间目录,比如 `a/**/z` 可以匹配 `a/z` 、 `a/b/z` 或 `a/b/c/z` 等。
使用两个星号(`\**`)表示匹配任意中间目录,比如 `a/**/z` 可以匹配 `a/z` 、 `a/b/z` 或 `a/b/c/z` 等。

我们再看一个 `.gitignore` 文件的例子:

Expand Down

0 comments on commit a79913e

Please sign in to comment.