Gitignore 不忽略 elpa emacs 文件夹

Gitignore not ignoring elpa emacs folder

我不确定为什么 gitignore 不工作,但出于某种原因它不断尝试将 /elpa/ 目录添加到版本控制。这是我的 gitignore(在我的 dotfiles 存储库的根目录中)

*.swp
*.swo
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
.org-id-locations
*_archive
*_flymake.*
/eshell/history
/eshell/lastdir
/elpa/
*.rel
/auto/
.cask/
*.last
/elpa/*
/.emacs.d/elpa/*

请注意,我在这里尝试了 3 种不同的 elpa,其中 none 正在运行。有谁知道为什么?

目录结构为

|- configurations  
 - .gitignore
 |- dotfiles
   |- emacs.d
      | -elpa
      - init.el
      - etc

/elpa/(以'/'开头)意味着它只会忽略.gitignore.
级别的那个 没有 .gitignore 文件下面的任何 elpa 文件夹。

elpa/ 将忽略所有 elpa 个文件夹。
(不需要 elpa/*

来自 gitignore man page:

A leading slash matches the beginning of the pathname.
For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".