Jestem zaskoczony, że proste wzorce, takie jak * .user w pliku .gitignore, wydają się pasować do plików o nazwach plików i.Jak gitignore * tylko * pliki?
ringods$ mkdir TestIgnore
ringods$ cd TestIgnore/
ringods$ git init
Initialized empty Git repository in /Users/ringods/Projects/hostbasket/TestIgnore/.git/
ringods$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
ringods$ mkdir security.user
ringods$ touch security.user/file_may_not_be_ignored.txt
ringods$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# security.user/
nothing added to commit but untracked files present (use "git add" to track)
ringods$ echo "*.user"> .gitignore
ringods$ cat .gitignore
*.user
ringods$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
nothing added to commit but untracked files present (use "git add" to track)
Czy mam złe oczekiwania? Jak mogę napisać proste pliki ignorujące o rozszerzeniu z rozszerzeniem blah i zapobiec dopasowaniu folderów kończących się na .blah?
Model gitignore man page wspomina, że wzorce bez a/są dopasowane przy użyciu funkcjonalności globalnej powłoki, ale tak naprawdę nie mówi mi, czy pasuje tylko do plików lub plików i katalogów.