git .gitignore 通配符不起作用?(“LIVE-*”模式与“LIVE-vhost”文件名不匹配)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4021040/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 04:40:23  来源:igfitidea点击:

.gitignore wildcard not working? ("LIVE-* " pattern doesn't match "LIVE-vhost" filename)

gitgitignore

提问by bobinabottle

Super quick one. Here is my .gitignore (at the root level of my repo

超级快的。这是我的 .gitignore (在我的 repo 的根级别

# Makefile stuff
LIVE-* 
.install-post-all

When I do this, The LIVE-* bit isn't working:

当我这样做时, LIVE-* 位不起作用:

$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   pm-h8/etc/apache2/conf.d/LIVE-vhost
nothing added to commit but untracked files present (use "git add" to track)

What am I doing wrong?

我究竟做错了什么?

回答by Ronald

Remove the blank space after the string you want to match.

删除要匹配的字符串后的空格。

回答by Clinton

Try wildcarding the directory as well:

也尝试通配目录:

**/LIVE-*