5

This question already has an answer here:

I'm brand-new to Emacs and I want to put my ~/.emacs.d under version control, much like I've done in the past with my vim setup. I installed a couple packages before initializing a git repo, and now I'm sifting through the contents of emacs.d trying to figure out what came from where, and what I should add to my gitignore.

The folder contents are currently

auto-save-list/
elpa/
url/

I've added auto-save-list to my gitignore, but I'm less clear about the elpa and url directories. I gather elpa houses the packages I've installed, but I'm not sure whether I should put those under version control, and I have no idea what the url directory is about.

Any help/advice to a noob would be much appreciated.

marked as duplicate by erikstokes, Drew, itsjeyd, Luke, Scott Weldon Jun 8 '15 at 15:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    If you reprhase this to be about the role of the url/ directory, then the question will no longer be a duplicate. – Andrew Swann Jun 8 '15 at 6:57
10

There are lots of different ways to organize your .emacs.d. You should probably have a look at some of the great examples here and here.

Most of the time, what you want to keep under version control is your personal emacs configuration: the elisp files and directories you edit and modify to personalize your emacs.

Under my .emacs.d/, for example, I have an init.el file and the lisp/ & elisp/ directories (elisp configuration/customization files etc). Those are the only things I keep under version control.

Based on my tiny experience, I've never found a good reason to keep those autogenerated directories under version control.

2

Since I also wanted to sync the same emacs.d folder to several other machines that I normally use (desktops, laptops, home, work, etc.), I kept the whole emacs.d folder under git when starting out. As I implemented various customizations, I started expanding .gitignore to selectively exclude unwanted sub-folders of the .emacs.d folder. This approach allowed me to customize which folders got version control as my .emacs.d folder has several development folders, test folders, and so on. Not all folders need to be under version control, but you won't know which ones until you figure out your use case. Hope this helps.

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