Use Git repositories as Emacs package archives

04 Mar 2023 -

It is possible to use git repositories as Emacs package-archives. I’m using that possibility to host my personal Emacs packages, here: https://codeberg.org/mmontone/emacs-snippets

To implement, I create a package archive and push to a git repository. Use package-upload-file command to add the package files to the package archive. Then push to a git repository online.

After that, the “raw” url needs to be added to package-archives to access the new repository with the packages from Emacs tools (package-list-packages and friends).

Whenever a package changes it needs to be “uploaded” to the folder using package-upload-file and pushed to the git repository.

This is how I manage my personal packages using the method I’ve described:

(add-to-list 'package-archives '("emacs-snippets" . "https://codeberg.org/mmontone/emacs-snippets/raw/branch/master/"))

Then I can browse the packages from the git repository with package-list-packages and friends.

As another example, this adds EmacsWiki elfiles as repository:

(add-to-list 'package-archives '("emacswiki" . "https://raw.githubusercontent.com/varlardohaeris/emacs-archives/master/emacswiki/"))

Page design by Ankit Sultana