2016-06-29 36 views
0
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 

即使有這個忽略選擇器** /。元我仍然看到下面的提交消息。我不知道爲什麼選擇器** /。DS_Store按預期工作,但** /。meta沒有。這是正確的語法忽略任何文件夾中的.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 

任何建議我需要改變。

回答

1

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

你可以只是這樣做:

*.meta 

這將忽略每一個*.meta文件中的所有目錄。

同樣,.DS_Store應該只被列爲

.DS_Store 

忽略它的所有實例。

1

.gitignore文件應該位於您的git項目的根目錄(與.git文件夾一起)。

*.meta 
+0

啊:

然後,向您Git項目只需添加以下到您的.gitignore忽略任何文件夾中的所有* .META文件。我將它更新爲**/*。meta並且工作正常。我會盡快嘗試最簡單的語法。 – Darian311