这是在任何文件夹中忽略.meta的正确语法吗?

时间:2016-06-29 21:05:02

标签: git gitignore

Darians-MacBook-Pro:village-makeover darianhickman$ cat .gitignore
*.pyc
/ige
/libs
/config.yaml
/config-dev.yaml
/config-prod.yaml
/.venv
/client/deploy
/.idea
/client/index_deploy.csstest.html
**/.DS_Store
**/.meta
update_prod.sh
villagegamedev2_deploy.sh

即使使用此忽略选择器** / .meta,我仍然会看到下面的提交消息。我不知道为什么选择器** / .DS_Store按预期工作,但** /。meta不能。

#   (use "git push" to publish your local commits)
#
# Changes to be committed:
#       new file:   assets/audio/Music.meta
#       new file:   assets/audio/Stings_Jingles.meta
#       new file:   assets/audio/music/CGM_Bonus Level - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Bonus Level - Rhythm Only.wav.meta
#       new file:   assets/audio/music/CGM_Game Lose 1 (fast).wav.meta
#       new file:   assets/audio/music/CGM_Game Lose 1.wav.meta
#       new file:   assets/audio/music/CGM_Game Lose 2.wav.meta
#       new file:   assets/audio/music/CGM_Game Lose Jingle 1_loop (fast).wav.meta
#       new file:   assets/audio/music/CGM_Game Lose Jingle 1_loop.wav.meta
#       new file:   assets/audio/music/CGM_Game Win 1 (fast).wav.meta
#       new file:   assets/audio/music/CGM_Game Win 1.wav.meta
#       new file:   assets/audio/music/CGM_Game Win 2.wav.meta
#       new file:   assets/audio/music/CGM_Game Win Jingle 1_loop (fast).wav.meta
#       new file:   assets/audio/music/CGM_Game Win Jingle 1_loop.wav.meta
#       new file:   assets/audio/music/CGM_Level 1 - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Level 2 - (no per.).wav.meta
#       new file:   assets/audio/music/CGM_Level 2 - 30s (no per.).wav.meta
#       new file:   assets/audio/music/CGM_Level 2 - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Level 3 - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Level 3 - No Melody.wav.meta
#       new file:   assets/audio/music/CGM_Main Theme - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Map - FULL.wav.meta
#       new file:   assets/audio/music/CGM_Map - Intro.wav.meta
#       new file:   assets/audio/music/CGM_Map - No Intro.wav.meta
#       new file:   assets/audio/music/CGM_Store - FULL.wav.meta
#       new file:   assets/audio/music/Casual Game Music Pack by [WOWSound].pdf.meta

任何建议我需要改变。

2 个答案:

答案 0 :(得分:1)

您忽略了文件.meta,而不是*.meta

你可以这样做:

*.meta

这将忽略每个目录中的每个*.meta文件。

同样,.DS_Store应该只列为

.DS_Store

忽略它的所有实例。

答案 1 :(得分:1)

.gitignore文件应位于您的git项目的根目录(与.git文件夹一起)。

然后,要忽略git项目的任何文件夹中的所有* .meta文件,只需将以下内容添加到.gitignore中:

*.meta