I keep ~/.emacs.d/ under version control with git. I used to gitignore the elpa/ directory, but recently started including it in case I ever want to rollback a package upgrade.

I just noticed an untracked directory on my work machine: ~/.emacs.d/elpa/gnupg/. I'm not sure where it came from. I remember trying to set up a gnupg key at some point on this machine, but I don't know if that's the cause.

Should I gitignore it? I don't understand it's role well enough to say for sure.

2 Answers 2


It's where package.el keeps the keys used to authenticate the packages that it downloads. You don't need to gitignore it, but of course, it might leads to merge conflicts in some cases, so you may choose to gitignore it (it should be auto-created if/when necessary).


Well, I'd say it's configurable!

(require 'package)

 package--init-file-ensured t
 package-user-dir  (expand-file-name "gnupg" "~/.local/emacs/packages"))

;; Emacs >= 26.1
(when (boundp 'package-gnupghome-dir)
  (setq package-gnupghome-dir
         (expand-file-name "gnupg" "~/.local/emacs/gnupg")))

;; Initialize package manager.
(unless package-archive-contents (package-refresh-contents))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.