I want to put my .spacemacs into Github, so I cloned it to a local directory. How to let Emacs use the .spacemacs in that directory instead of from the default ~/.spacemacs?
In much the same way as Emacs loads
~/.emacs.d/init.el if it can't find a
~/.emacs file, so does Spacemacs load
~/.spacemacs.d/init.el if it can't find a
This means you can create a
~/.spacemacs.d directory and rename the
~/.spacemacs file to
~/.spacemacs.d/init.el. Then you put the
~/.spacemacs.d directory on GitHub, and you're done.
If you have some private layers, you can also move them inside
~/.spacemacs.d/ and manage them in the same repository.
You can symlink your
.spacemacs file. From a bash prompt:
$ ln -s /path/to/your/spacemacs-directory/.spacemacs ~/.spacemacs
You might find it easier to symlink the entire directory to a "dot directory," i.e.
~/.spacemacs.d, in which case you would do this:
$ mv /path/to/your/spacemacs-directory/.spacemacs /path/to/your/spacemacs-directory/init.el $ ln -s /path/to/your/spacemacs-directory ~/.spacemacs.d