I just did that using chemacs.
Considering you don't have an .emacs file in your home folder you can follow this instruction to install it:
Clone the Git repository, and run install.sh
$ git clone https://github.com/plexus/chemacs.git
$ cd chemacs
$ ./install.sh
you should get this message:
OK Creating symlink ~/.emacs -> /home/arne/chemacs/.emacs
If you already have an .emacs file, rename or move it somewhere.
Next step, create the file: .emacs-profiles.el in your home folder:
$ touch .emacs-profiles.el
Here is an example of the this file:
(("default" . ((user-emacs-directory . "~/.emacs.d")))
("spacemacs" . ((user-emacs-directory . "~/spacemacs"))))
Mine looks like this:
(("default" . ((user-emacs-directory . "~/.emacs.d"))) ;; DoomEmacs, my default emacs
("prelude" . ((user-emacs-directory . "~/emacsprelude/.emacs.d"))) ;; Prelude
("goodemacs" . ((user-emacs-directory . "~/myemacs/.emacs.d"))) ;; my own config
("spacemacs" . ((user-emacs-directory . "~/spacemacs/.emacs.d")))) ;; Spacemacs
Here I create the file ~/myemacs/.emacs.d/init.el
, for my own config.
Now to use a config, I run one of the following command:
$ emacs --with-profile
$ emacs --with-profile myemacs
$ emacs --with-profile prelude
$ emacs --with-profile spacemacs
Hope this help.
Update:
There is a newer version of chemacs called chemacs2.
Update 2:
Emacs 29 has now this feature built-in.