有没有办法git ignore file忽略所有名称为test的文件?
我有这样的文件:
- css/test.css
- js/subfolder/test.js
- lib/main/sub/test.html
Run Code Online (Sandbox Code Playgroud)
等等.
我想git避免使用名称test添加或提交任何文件.
Ale*_*.K. 47
来自git docs
A leading "**" followed by a slash means match in all directories. For
example, "**/foo" matches file or directory "foo" anywhere, the same
as pattern "foo". "**/foo/bar" matches file or directory "bar"
anywhere that is directly under directory "foo".
Run Code Online (Sandbox Code Playgroud)
对于你的情况:
**/[Tt]est*
Run Code Online (Sandbox Code Playgroud)
它也匹配大小写.
| 归档时间: |
|
| 查看次数: |
25906 次 |
| 最近记录: |