Emacs is less an editor and more an ELisp environment with an editor. Your settings are written in ELisp (Emacs Lisp). ELisp is extremely powerful. One option is to maintain one set of settings and use ELisp to differentiate between "remote" and "personal" features. Use an environment variable or a dot file or whatever you like to indicate "remote" vs "personal". This is probably the least hassle.
Here's an example from my .emacs
. Aquamacs defaults alt-w to kill the current frame. This rebinds it to kill the current buffer. Aquamacs uses osx-key-mode-map
for key binding, so it first checks for that so the config continues to work with other Emacs implementations.
(defun kill-current-buffer ()
(interactive)
(kill-buffer (current-buffer)))
(when (boundp 'osx-key-mode-map)
(define-key osx-key-mode-map '[(alt w)] 'kill-current-buffer))
The alternative is to maintain three branches. Start with universal
and then branch personal
and remote
from it. When you want to add something, the procedure to would go something like this...
When you add a feature specific to personal
or remote
, add it to the appropriate branch. If you decide a feature is actually universal, you can use git-cherry-pick
to add it to universal
.
When you add a universal feature, commit it to the universal
branch and then git checkout remote; git merge universal; git checkout personal; git merge universal
.
Then clone the repository and checkout the appropriate branch.