tags:

views:

504

answers:

4

I hear a lot of Emacs users have their init file (.emacs or init.el) under git version control and sync the git repository over Dropbox, when they run Emacs on multiple systems. Why would you use git in this situation exactly?

Usually checking which system you're on and which things to load and set depending on that can happen in one and the same init file for all systems. Why exactly would you want to save a version history of your init file, is it really that important that it justifies a git repository for it?

So, isn't it simply enough to put your init file in a Dropbox directory and load that one directly from Emacs directly instead of pulling the newest version from your synced git repo in Dropbox?

A: 

Once developers find a version control system they like, there is a tendency to use it for all important files. -- You're ensuring that the files will always be backed up, managed, maintain a history (including log of comments, reasons for the changes, etc)

Git has attracted a lot of users, I'm not surprised to hear of people using it for tracking init files.

Larry K
Indeed. http://github.com/technomancy/emacs-starter-kit/network
Ben Straub
+4  A: 

Git gives you version control, Dropbox gives you gratis private hosting.

Until recently, this was the only gratis method of hosting a private Git repo that I know of. Gitorious, repo.or.cz and Co. don't have private repos and GitHub, ShareSource and friends charge money for private repos. Assembla is the only hoster I know of that offers gratis private repo hosting, but that offering only started three weeks ago.

Personal configuration files might contain sensitive data, so it makes sense to host them privately, but it maybe doesn't make sense to pay GitHub 7$/mo just for one single .emacs file.

Jörg W Mittag
The real question is, why would I want to have version control for my .emacs file?
Michiel Borkent
Ola Bini explains this here:http://olabini.com/blog/2008/05/how-large-is-your-emacs/
Andreas
+1  A: 

I use Dropbox not only for Emacs configuration files but also for all the other external packages (newer org-mode, SLIME, etc.) and individual .el files, so that I install and configure them (load path, info files, byte-compilation, etc.) only once for all the systems, and use Git to manage the configuration files (general setup, system or OS-specific customization).

After that, it's all downhill, as I put tons of reference material in my Dropbox (API docs, protocol stuff, cheat sheets, etc.) as well as development stuff (Java jar files, sources, etc.) so that I have the same development environment on all my systems with Emacs commands to access all the stuff.

gko
Using Dropbox for that isn't the question. The question is, why also use a version control system, in this case, git, on top of that.
Michiel Borkent
gko
A: 

As long as you think of your configuration files as code, you want to use a proper VCS. Dropbox gives some value, but it's not in the same league as git.

The short of it is that when you work with code, you want more than just to roll back to previous versions of the document. You want a quick and effective way to look at the differences between versions. You want to know what changed, why it changed, when, etc. You want to create experimental branches where you try something new without cluttering something you know works. You want to pull some of the changes from the experiment into your stable branch; but maybe not all of it.

Another issue is that in the future you might want to move your files, including all history, from Dropbox for some reason or other. If you use git, this is trivial.

Alf